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 |
|
anjali66
Starting Member
23 Posts |
Posted - 2011-01-07 : 18:02:29
|
| is their any way, I can add identity column in an already existing table?Please help |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2011-01-07 : 18:09:26
|
| ALTER TABLE myTable ADD newColumn int NOT NULL IDENTITY(1,1) |
 |
|
|
ahmeds08
Aged Yak Warrior
737 Posts |
Posted - 2011-01-07 : 23:57:30
|
| do you want to add a new identity column or else want to add identity property to a existing column.if you want to add a new identity column robvolk has given the solution. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-01-08 : 01:02:28
|
| you cant directly change identity property of existing column . for that you need something likehttp://www.mssqltips.com/tip.asp?tip=1397if you just want to add a new column of type identity the above solution is enough------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
anjali66
Starting Member
23 Posts |
Posted - 2011-01-08 : 10:01:47
|
| Thanks Visakh and RobVolk. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-01-08 : 13:01:40
|
| welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|