Resetting the table identity values

By Raja Baireddy

To reset the identity value in database table

 

Syntax: DBCC checkident (tablename, reseed, 0)

 

DBCC checkident can reseed the value of the table. For e.g.: our table has 25 records with 25 as last identity. If we want next record to have identity has 35 we need to run following T-SQL

 

DBCC checkidetnt (tablename, reseed, 34)

 

Disadvantage: It will violate the uniqueness.

Leave a Reply