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 |
|
karthickbabu
Posting Yak Master
151 Posts |
Posted - 2008-01-17 : 06:41:12
|
| Is it possible to add, change, modify and drop one more column in a single query.I tried, ALTER TABLE Table_Name ADD Col1 DataType, Col2 DataTypeIts added two columns Likewise i change, modify and drop one more columns in a single queryI tried, It shows error So is this possible or not.ALTER TABLE Table_Name CHANGE Old_Col1 New_Col1 DataType, Old_Col2 New_Col2 DataTypeALTER TABLE Table_Name CHANGE (Old_Col1 New_Col1 DataType, Old_Col2 New_Col2 DataType)Both shows errorsSimilarly to modify and drop also.Kindly replyWhen you realize you've made a mistake, take immediate steps to correct it. |
|
|
sunil
Constraint Violating Yak Guru
282 Posts |
Posted - 2008-01-17 : 06:54:19
|
| It is not possible to alter multiple columns in a single AlTER TABLE query. You need to specify multiple alter statements. Refer BOL for ALTER TABLE |
 |
|
|
karthickbabu
Posting Yak Master
151 Posts |
Posted - 2008-01-17 : 07:06:27
|
| Thank you sunil |
 |
|
|
sunil
Constraint Violating Yak Guru
282 Posts |
Posted - 2008-01-17 : 07:12:22
|
| It seems you are just beginning to learn sql. I will suggest you to go through following links to get a idea about SQL.http://www.sql-tutorial.nethttp://www/w3schools.com Get a beginners SQL book and practise SQL exercises. |
 |
|
|
|
|
|