0

How to reset the identity field

Query

DBCC CHECKIDENT('table1', RESEED, 0)

The above query is reseting all identity field, but i want to reset from 5001 onwards.

Table1

id value

1 100
..
..
5000 430
6501 232
6501 343
...

From 5001 to 6500 (identity is not creating, so i want to reset the identity from 5000 onwards).

Expected Output

id value

1 100
..
..
5000 430
5001 280
...

How to make a query

Gopal
  • 11,712
  • 52
  • 154
  • 229

1 Answers1

4

You already answered to your question 8-)

DBCC CHECKIDENT('table1', RESEED, 5001)
Oleg Dok
  • 21,109
  • 4
  • 45
  • 54