I have a table with a identity column. I need to reset that identity column from zero. What should i do for this.
Asked
Active
Viewed 2.7k times
22
-
1A similar post: http://stackoverflow.com/questions/510121/ – o.k.w Jan 21 '10 at 07:23
1 Answers
40
Use DBCC CHECKIDENT:
DBCC CHECKIDENT(<tablename>, RESEED, 0);

Remus Rusanu
- 288,378
- 40
- 442
- 569
-
1The command works in sql server 2014, but you have to put tablename in square brackets ;) : DBCC CHECKIDENT([tablename], RESEED, 0); – Tommy Mar 30 '18 at 10:12