Dears ;
I want to reset unique ID of a table which is of type AutoNumber in SQL Server 7.0 Database. When , I delete records then the next is greater than previous one. Is there any solution.
Truncate table will reset the id back to it's initial value and delete the rows. Just keep in mind that it is not logged and is therefore, unrecoverable.
If you have deleted all of the rows, then you can also safely use DBCC CHECKIDENT ('table_name', RESEED, new_reseed_value) as in: DBCC CHECKIDENT ('authors', RESEED, 1)... I wouldn't use this approach if you are trying to reseed the seed to a value that is less than an existing value, which will cause problems... Tom Davis
tdavis@sark.com
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.