MSSQL Wish to to reset the column with correct sequence post insert/delete data in an auto increment (auto id ) column

MSSQL Wish to to reset the column with correct sequence post insert/delete data in an auto increment (auto id ) column  
npglobalAsked:
Who is Participating?
 
Aneesh RetnakaranDatabase AdministratorCommented:
DBCC CHECKIDENT (yourtable, reseed, UrExpectedNextNumber-1)
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
if you want to restart the number from 1, you  just need to TRUNCATE the table
0
 
npglobalAuthor Commented:
Thanks,
     Is there no slution except truncating the table and then restting it.
0
 
npglobalAuthor Commented:
Thanks a lot
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.