DBCC CHECKIDENT Sets Identity to 0

前端 未结 10 1315
长发绾君心
长发绾君心 2020-12-07 21:55

I\'m using this code to reset the identity on a table:

DBCC CHECKIDENT(\'TableName\', RESEED, 0)

This works fine most of the time, with the f

10条回答
  •  情歌与酒
    2020-12-07 22:25

    Change statement to

      DBCC CHECKIDENT('TableName', RESEED, 1)
    

    This will start from 2 (or 1 when you recreate table), but it will never be 0.

提交回复
热议问题