Reset the Autoincrement column in MSSQL

By Eric Downing. Filed in Uncategorized  |  
TOP del.icio.us digg

To reset the identity column in MSSQL use the following:

DBCC CHECKIDENT (tablename, RESEED, 0)

Just replace tablename with the table, and change the 0 to the number minus 1 that you want to have as the next row.

For example, entering 0 (zero) will give the next row identity of 1.

Tags:

Leave a Reply