I have a table with in my sql server database that is a key field which consists of a number (ex. 1-50,000). Is there a way to insert that key number into the database when entering data and start from the last known value?
Asked
Active
Viewed 102 times
0
-
1I believe you're looking for the IDENTITY field: http://msdn.microsoft.com/en-us/library/ms186775.aspx – sazh May 14 '12 at 20:44
-
1can't you use an autonumeric identity field? Does not suit in your solution? – Luis Quijada May 14 '12 at 20:45
-
Please check [Adding an identity to an existing column](http://stackoverflow.com/questions/1049210/adding-an-identity-to-an-existing-column). – Nikola Markovinović May 14 '12 at 22:25
1 Answers
0
Set the Identity Seed value of your field to the number you want to start from
ex. if you want to start from 10000 so your next value will be 10001,

AmmarR
- 248
- 1
- 11