SQL Adding autonumbered primary key

Hi,

I have a table, and would like to add a new column which I would like autonumbered and used as a primary key

Thanks
BananaFuryAsked:
Who is Participating?
 
Ross TurnerConnect With a Mentor Management Information Support AnalystCommented:
Add an identity column

you can only have one identity column on a table...

http://msdn.microsoft.com/en-us/library/ms186775.aspx

here an quick example

http://sqlfiddle.com/#!3/6e601/1
0
 
BananaFuryAuthor Commented:
Thanks very much, that example is super useful, appreciated
0
 
Ross TurnerManagement Information Support AnalystCommented:
Remember always take a BACK UP if you haven't already got one.....
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.