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 |
|
arorarahul.0688
Posting Yak Master
125 Posts |
Posted - 2010-03-30 : 01:42:13
|
| Hi All,Can you please help me on this...Can I alter a column in an existing table, to identity column. Table doesn't contains any data till the moment.I cant drop the column or table to redesign as the column is primary key in table and 'On delete cascade option' is not on.Thanks,Rahul Arora NCCE, Panipat ######################IMPOSSIBLE = I+M+POSSIBLE |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2010-03-30 : 01:59:40
|
| Alter the column as identity is not possible.Rather the you have two option1.Recreate the table with identity and drop the old one.2.Create a new column with identity and drop the old column.Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/ |
 |
|
|
maevr
Posting Yak Master
169 Posts |
Posted - 2010-03-30 : 02:09:48
|
| If you have ms sql srvr mgmt studio you can do it. You just have to do it manually, not in script or command form.1. connect to your db2. show the table/column names in object explorer window3. right click on column name4. select modify in column properties tab5. alter "identity specification"/"is identity" to YES6. set increment/seed properties as desired |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|
|