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 |
llzamboni
Starting Member
5 Posts |
Posted - 2006-11-09 : 17:02:12
|
I am porting a database from Informix to SQL Server 2000. Several fields in the informix database are specified as SERIAL, which means that they auto-increment auto-magically if you insert a 0 into them. Well...I was looking for an equivalent in SQL Server 2000, and thought I had found it in the IDENTITY column concept. With further investigation into IDENTITY columns, however, I discovered that only one column per table can be given the IDENTITY property. Why is this? Is there a way around that? If not, is there another way to achieve this feature in SQL Server 2000? If not, any suggestions on how I can do it?Thanks!Lisa |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2006-11-09 : 17:04:11
|
only one column per table can be set as identity.you can also achieve this behavior with after insert triggers.Go with the flow & have fun! Else fight the flow blog thingie: http://weblogs.sqlteam.com/mladenp |
|
|
llzamboni
Starting Member
5 Posts |
Posted - 2006-11-09 : 17:12:05
|
Could you elaborate on how an after insert trigger might look? |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
|
|
|
|