Auto increment two fields in SQL Server 2008
Possible Duplicate:
How can I have two columns in SQL Server auto increment?
How do I auto increment two fields in a SQL Server 2008 database table [Note:one is primary key field and other one field is just bigint datatype column], I've had a look through the forum but can't see how.
I have set the primary key with "Identity" option to auto increment but how to do for other field, since we cannot have two "identity" columns set in same table.
As seen Here There is no requirement that IDENTITY column be made a primary key. You can make your primary with multipe columns and use IDENTITY with your second column.
And as seen Here, if you need IDENTITY on the first, you can make a trigger on insertion.
链接地址: http://www.djcxy.com/p/94432.html