Reset Identity Column Value In Sql Server Table

How To Reset Identity Column In Sql Server Table To Start Auto Increment Or Seed From Desired Number

If we delete All data from Sql Server table having Identity Column with Identity Seed as 1 and insert new data Identity column value doesn't get reset and it starts from last number.

If table were having 10 records and we insert new records after deleting all records in table, identity column would start from 11 if identity seed is 1.

we can use below mentioned command to reset Identity Column.


DBCC CHECKIDENT('YouTableName', RESEED, 0)


If you like this post than join us or share

3 comments:

venki said...

hi i tried but i didn't get ..

DBCC CHECKIDENT('emp', RESEED, 0)

Checking identity information: current identity value '0', current column value '0'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.


venki said...

sorry i got it .. actually i checked with Removing columns from middle then i applied for this so i didn't observe any change..


Anonymous said...

This comment has been removed by a blog administrator.


Find More Articles