Click here to Skip to main content
15,891,629 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Can I have two Identity columns? If not, please solve below problem.

I have two columns I need to auto-increment. One(ID) starts at 1, the other(username) at 1000 in sql server 2005
Posted
Updated 14-Apr-10 20:53pm
v2

I don't believe you can have two Identiy columns. But you can make the username a computed column, or fill it automaticly in a trigger.
 
Share this answer
 
You can only have one identity column per table. You can simulate an auto-increment column by using a trigger.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900