Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
terbs
Starting Member
29 Posts |
Posted - 2007-07-10 : 02:43:24
|
How would I create an incremented primary key field that stays within a particular range depending on a variable. Say if my input variable was "1", then I would increment between 10 000 - 20 000 for my primary key.If it were "2", between 20 000 - 30 000.. etc etc.Each time adding +1 within the range.E.g second entry for input variable "1" would have its primary key as 10 002.Apologise for my lack of input, its just I have never touched incrementing, except for using Identity Hope you guys can help, cheers  |
|
|
LoztInSpace
Aged Yak Warrior
940 Posts |
Posted - 2007-07-11 : 04:02:19
|
| Use an identity column on your table to generate values but create the primary key as the new value of that + some value depending on your input variable.It all sounds very dodgy to me though. Why would you want to so something like this? |
 |
|
|
|
|
|