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 |
|
wkm1925
Posting Yak Master
207 Posts |
Posted - 2010-01-25 : 01:23:30
|
| Alter Table BusType Alter Column Col1 tinyint not null -- this statement is accurateI want to alter column more than 1 columnAlter Table BusType Alter Column (Col1 tinyint not null,Col2 tinyint not null) -- this statement got incorrect syntaxneed help |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-01-25 : 01:43:46
|
| An Alter Table ... Alter column can only alter 1 column per statement. So to alter 2 columns, you need two alter table statements--Gail ShawSQL Server MVP |
 |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2010-01-25 : 01:44:18
|
| Alter Multiple column in a single alter command is not possible.You need to write twice.Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/ |
 |
|
|
wkm1925
Posting Yak Master
207 Posts |
Posted - 2010-01-25 : 01:47:29
|
| ok. tq very much |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-01-25 : 02:32:16
|
| You can:Create a new, temporary, table with correct structureCopy data from Old to New tableDrop old tableRename New table to original table nameIf you use SSMS Table Design Tools you can generate a script (rather than just pressing "Save" for SSMS to make the changes for you) which will have all the correct SQL DDL statements to make the change - including drop/recreating FKs, Indexes, etc |
 |
|
|
|
|
|