Fatih
Fatih

Reputation: 810

How to Specifiy Primary Key Starting Number in SQL

There is a table named User in database. Columns as follows:

ID
FirstName
LastName

ID is primary key and auto incremented in this case. I have only 7 records; last ID of data is 7.

How can I increment ID starting from any number (eg. 10000).

Upvotes: 0

Views: 1712

Answers (1)

DarkRob
DarkRob

Reputation: 3833

You may use this. CHECKIDENT is use to reseed the value of your identity column. For more info you may find this link.LINK.

 DBCC CHECKIDENT ('Yourtable', RESEED, yournumber);    ---- here yournumber is the number to reseed.

Upvotes: 2

Related Questions