Click to See Complete Forum and Search --> : reset autonumber field


yshie
April 28th, 2007, 08:00 AM
SQL SERVER

after deleting my test records in my table, the autonumber field is not working right anymore. the table is started not with 1 but with 22. how will i fix it in the easiest way? tnx

hspc
April 28th, 2007, 11:47 PM
I don't know why do you need this..
Anyway. using Truncate table (http://msdn2.microsoft.com/en-us/library/ms177570.aspx) statement to will reset identity (auto increment) fields.

Shuja Ali
April 29th, 2007, 11:32 PM
You could also use DBCC CHECKIDENT (http://msdn2.microsoft.com/en-us/library/ms176057.aspx).