Home / Software / Tips and Tricks / How to Reset Identity column in SQL Server?

How to Reset Identity column in SQL Server?

Updated:  01/09/2013 12:01 PM
Author:  Shiju Mathews

Status:    Resolved.


DBCC CHECKIDENT cane be used to check the current identity value for the specified table and, if it is needed, changes the identity value. You can also use DBCC CHECKIDENT to manually set a new current identity value for the identity column.

Syntax:



table_name:
Is the name of the table for which to check the current identity value. The table specified must contain an identity column. Table names must comply with the rules for identifiers.
NORESEED :
Specifies that the current identity value should not be changed.
RESEED :
Specifies that the current identity value should be changed.
new_reseed_value :
Is the new value to use as the current value of the identity column.
WITH NO_INFOMSGS:
Suppresses all informational messages.

To reseed the value to 1


The identity column value for the next inserted row will be 0 + 1 = 1