SQL server identity column values start at 0 instead of 1

后端 未结 6 1993
孤城傲影
孤城傲影 2020-12-01 20:40

I\'ve got a strange situation with some tables in my database starting its IDs from 0, even though TABLE CREATE has IDENTITY(1,1). This is so for some tables, but not for ot

6条回答
  •  春和景丽
    2020-12-01 21:18

    This is logical, since you've changed (reseeded) the identity value to zero ?

    DBCC CHECKIDENT (SyncSession, reseed, 1)
    

    will reseed your identity column, and make sure that the first new record will start with 1.

提交回复
热议问题