Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 Site Related Forums
 Article Discussion
 Auto-incrementing a field
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

5 Posts

Posted - 11/09/2006 :  17:02:12  Show Profile  Reply with Quote
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?



Cybernetic Yak Master

11752 Posts

Posted - 11/09/2006 :  17:04:11  Show Profile  Visit spirit1's Homepage  Reply with Quote
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:
Go to Top of Page

Starting Member

5 Posts

Posted - 11/09/2006 :  17:12:05  Show Profile  Reply with Quote
Could you elaborate on how an after insert trigger might look?
Go to Top of Page

Flowing Fount of Yak Knowledge

6065 Posts

Posted - 11/09/2006 :  17:51:54  Show Profile  Reply with Quote
This discussion seems to have been continued in the cross posted version :)

Be One with the Optimizer
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2019 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000