I have been searching for how to change (alter) the starting value of the int identity in MSSQL Server. Currently it starts at 1, I need it to start at 1000?
Asked
Active
Viewed 4,052 times
0
-
What part of the BooksOnline description of the identity property didn't you understand? This is clearly explained in the SQL Server help files. – HLGEM Jan 29 '15 at 18:25
1 Answers
0
You need to set the Identity seed to that value:
CREATE TABLE yourtable
(
id int IDENTITY(9586,1)
)
To alter a current table:
ALTER TABLE orders ALTER COLUMN Id IDENTITY (9586, 1);

Hiren Dhaduk
- 2,760
- 2
- 19
- 21
-
I tried this solution, but didn't worked (SQLServer over Linux). The one that worked for me, it's that one from [here](https://stackoverflow.com/a/16983/3122531) – mginius Jan 29 '18 at 09:52