A family of Microsoft relational database management systems designed for ease of use.
Wipe it clean, delete all its records, clear.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi all!
Is there a way to reset a primary key (autonumber) back to a starting number of 1?
Dave
A family of Microsoft relational database management systems designed for ease of use.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Answer accepted by question author
Wipe it clean, delete all its records, clear.
I tried that and the primary key did not reset.
If you have a primary key and then you had a relationship set then it may not reset with child records in the other table(s).
But you can try using my free database reset tool if you want to make it easier:
I can't get the URL right now but it is in the Free Tools section of http://www.btabdevelopment.com.
I tried that and the primary key did not reset.
I have been doing a lot of testing and the primary key numbers are way high as compared to the amount of real data. I was just wanting to reset that field back to match the amount of real data.
What exactly do you mean by truncate?
I'll chek out the link you sent.
Dave
My biggest question is why? PK serve no purpose but to be unique. You should not relly on them for anything beyond that. If you need a sequential number... then you need to create your own Number field that you control and populate accordingly.
The following post may be helpful and provide a few links worth investigating further: http://answers.microsoft.com/en-us/office/forum/office_2007-access/primary-key/eb3e2c0c-cd45-e011-90b6-1cc1de79d2e2
To directly answer your question,
If you truncate your table and perform a compact and repair, does that not reset your PK value to 1?