Can someone help please. I have built and tested my database and now need to delete all the data and reset all autonumbers. Is there an quick way to do this without having to create and run lots of delete queries?
Can someone help please. I have built and tested my database and now need to delete all the data and reset all autonumbers. Is there an quick way to do this without having to create and run lots of delete queries?
You can open your tables and do EDIT > SELECT ALL and then hit your delete key.
As for resetting your autonumbers, once the table is empty and you run a COMPACT and REPAIR on the database it should reset them.
However, hopefully you aren't using autonumbers for anything that the user sees. It should only matter to the system what they are and it can manage it just fine. Autonumbers are used to give you a UNIQUE number but they are never guaranteed to always be in sequential order and once a record is started or deleted that autonumber is gone.
Thanks for your help - I was rather hoping there was a simple way of creating a whole new set of blank tables - gets annoying having to delete from tables in the correct order to avoid problems with referential integrity rules but this certainly helps.
Thanks for your help - I was rather hoping there was a simple way of creating a whole new set of blank tables - gets annoying having to delete from tables in the correct order to avoid problems with referential integrity rules but this certainly helps.
Your situation made me wonder if I could create a tool to help. So I did. This should reset all non-linked tables in your database. If you don't want one to be reset you can delete the table from the list of tables to reset. Also, you can set the deletion order if you wish by setting the order in the order field. If you do, make sure to replace all ZERO entries with something as they will fire first.
This is a great tool - thank you. I am thinking, if I store the delete order in a table in each database, I can then run this to reset everything without having to think about the order more than once! (as long as I exclude the delete order table from the list). I really appreciate your help.
The tool does NON-linked tables (so if it is linked to Access tables then it needs to be done on the backend). If you have SQL Server (or other ODBC linked tables) it doesn't do those.