Reset autonumber (IDENTITY) column in SQL Server
Sometimes we need to reset the autonumber - identity column in a table.
Using the DELETE statement is not enough. The statement only deletes the data but not reset the identity column.
So how can we do it? First, wen need to delete the data from the table and after execute the DBCC command with CHECKIDENT switch in order to reset the data:
1: DELETE FROM tblName
2: DBCC CHECKIDENT (tblName,RESEED, 0)
(tblName is the table name).
Just be careful before deleting your data...