RESEED/Reset Table Identity Value in sql server
Posted by Viral Sarvaiya on January 6, 2012
DBCC CHECKIDENT can reset the identity value of the table,
For example if table has 500 reords and not we want to delete all records or want to start data from 600 then this command will help us.
DBCC CHECKIDENT (Table_name, reseed, 0)
DBCC CHECKIDENT (Table_name, reseed, 600)
Most of our identity we start with 1 so must have to take care that identity set to 0.
If identity is set below values that currently are in table, it will violate the uniqueness constraint as soon as the values start to duplicate and will generate error.