eTechtips

Tech Tips and Insights

Reset the Autoincrement column in MSSQL

/

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.

Loading

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.