Reset Column Identity in SQL Server

There are 2 ways to reset column identity in SQL Server:

  1. Using DBCC CHECKIDENT. Executing below statement in Management Studio will reset the identity column value for the Customer table to 0 so that next new record start at 1.
  2. Using TRUNCATE TABLE statement.
    TRUNCATE TABLE removes all rows from a table or specified partitions of a table, without logging the individual row deletions. TRUNCATE TABLE is similar to the DELETE statement with no WHERE clause; however, TRUNCATE TABLE is faster and uses fewer system and transaction log resources.

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.