Pages

Thursday 13 February 2014

How SQL Server Reset Identity Column Value to 1 in SQL Database

How SQL Server Reset Identity Column Value to 1 in SQL Database





To reset identity column value and start value from “1” during insert new records we need to write query to reset identity column value. Check below Query



DBCC CHECKIDENT (Table_Name, RESEED, New_Reseed_Value)


Table_Name is name of your identity column table
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.



<b>EX</b>: DBCC CHECKIDENT ('UserDetails', RESEED, 0)



No comments:

Post a Comment