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
  • 704,970
  • 168
  • 1,303
  • 1,425
Srinivasan
  • 11,248
  • 26
  • 61
  • 88

1 Answers1

40

Use DBCC CHECKIDENT:

DBCC CHECKIDENT(<tablename>, RESEED, 0);
Remus Rusanu
  • 281,117
  • 39
  • 423
  • 553
  • 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