Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have set the id in sql table to auto increment (1,1). When record is deleted the numbering does not reset to normal.

Please I need help.

What I have tried:

DBCC CHECKIDENT('quantity',reseed,0). But it worked for only once.
Posted
Updated 23-Jul-22 7:06am

1 solution

Simple. You don't do this at all. If you delete a record, the ID is just lost and not reused.

"Resetting" the ID's is not a thing. Since the ID of a record is used by other tables to match up related records, changing the ID in one table will break references to records in all other related tables, destroying your database integrity.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900