RESEED identity columns on the database

后端 未结 3 2026
难免孤独
难免孤独 2020-12-11 03:52

Can I use the

DBCC CHECKIDENT(, RESEED, value)

command to reset an identity column current value to the original one in

3条回答
  •  旧巷少年郎
    2020-12-11 04:35

    The value can be omitted. So if you use

    DBCC CHECKIDENT (, RESEED);
    

    SQL Server sets the ident value to the correct next number - according to the numbers already in use. This is the only way to reseed identity values I know.

提交回复
热议问题