Reset Identity Seed after deleting records in SQL Server

Updated on     Kisan Patel

Problem:

How to Reset Identity Seed after deleting records in SQL Server?

Solution:

The DBCC CHECKIDENT management command is used to reset identity counter.

The following example resets the current identity value, if it is needed, of the specified table in the database.

DBCC CHECKIDENT ('[TableName]');

The following example forces the current identity value in the identity column in the specified table to a value of 5.

DBCC CHECKIDENT ('[TableName]', RESEED, 5);

SQL Server

Leave a Reply