Tuesday, April 25, 2017

RESET IDENTITY VALUE OF IDENTITY COLUMNS IN SQL SERVER

When we use delete command in SQL Server to delete any record in the table. This will delete row from the table, but the identity value will not reset.

So we are using following SQL Command to reset the identity value after executing delete command in the table.

DBCC CHECKIDENT('[table_name]', RESEED, [new_reseed_value])
 


for example : 
DBCC CHECKIDENT('ColonyName', RESEED, 0)


for more detail :
Click following link 
RESET IDENTITY COLUMNS IN SQL SERVER