22

I have a table with a identity column. I need to reset that identity column from zero. What should i do for this.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Srinivasan
  • 11,718
  • 30
  • 64
  • 92

1 Answers1

40

Use DBCC CHECKIDENT:

DBCC CHECKIDENT(<tablename>, RESEED, 0);
Remus Rusanu
  • 288,378
  • 40
  • 442
  • 569
  • 1
    The 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