Set start value for column with autoincrement

后端 未结 4 1622
灰色年华
灰色年华 2020-11-28 23:47

I have a table Orders with the following fields:

Id | SubTotal | Tax | Shipping | DateCreated

The Id c

4条回答
  •  孤独总比滥情好
    2020-11-29 00:03

    From Resetting SQL Server Identity Columns:

    Retrieving the identity for the table Employees:

    DBCC checkident ('Employees')
    

    Repairing the identity seed (if for some reason the database is inserting duplicate identities):

    DBCC checkident ('Employees', reseed)
    

    Changing the identity seed for the table Employees to 1000:

    DBCC checkident ('Employees', reseed, 1000)
    

    The next row inserted will begin at 1001.

提交回复
热议问题