Reset Identity column in SQL Server
Filed in Database on Apr.16, 2009
For identity column in SQL Server, we have a command to easy to control it!
DBCC CHECKIDENT
1 : Resets the Identity value for the Customer table to 0 so that the next record added starts at 1.
DBCC CHECKIDENT(’Customer’, RESEED, 0)
2: Check current identify value:
DBCC CHECKIDENT (’tablename’, NORESEED)
3: Set the next ID start from 1000:
DBCC CHECKIDENT (‘tablename’, RESEED, 999)

Tags: SQL Server

Leave a Reply