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 |
sinjin67
Yak Posting Veteran
53 Posts |
Posted - 2008-01-10 : 17:03:44
|
Greetings All,I am moving from Foxpro to SQL. I am little confusedabout one aspect dealing with multiple autonumberingcolumns.In foxpro it will allow you to set your fields to "autonumber"so you can achieve having 3 or 4 fields for example with uniquenumbers, depending on the application function.When I try to do this in SQL I can setup my first identityand PK and it autonumbers just fine, when I try to setupa second autonumber column with a unique I cant seem toget control of the identity to set the starting seed, UnlessI select that column in the identity to yes, but it seems to disable the the first identity column I setup.Can anyone tell what I missed or doing wrong ?One last note, I am still using the Studio ManagerStill learning the programming portion..Thanks |
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2008-01-10 : 17:15:02
|
You can only have one identity column per table in SQL Server.Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
|
|
sinjin67
Yak Posting Veteran
53 Posts |
Posted - 2008-01-10 : 17:20:43
|
If thats the case, can I create a stored procedure or a triggerto grab the next number from a seperate table ?Does anyone maybe have an example of doing this ? |
|
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2008-01-10 : 17:29:19
|
You can. Not sure why you need multiple identity columns in same table..Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
|
|
sinjin67
Yak Posting Veteran
53 Posts |
Posted - 2008-01-10 : 17:41:48
|
Its been a real challange from the foxpro way tothe sql way. I am trying to recreate the originalapplication under sql and it was designed this way.Thanks |
|
|
|
|
|