views:

58

answers:

1

Is it possible to both alter a column and add a new column in the same alter table query for MSQL? I've tried looking at the below MSDN article, but it was a bit confusing to understand. I could easily do it with multiple queries, but would rather do it with one query if possible. Thanks.

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

+1  A: 

no you need to do it in separate batches

create table test(id int)
go

alter table Test add id2 int
go
alter table Test ALTER COLUMN id DECIMAL (5, 2) 

you can however add more than 1 column at a time

alter table Test add id3 int, id4 int
go
SQLMenace
Thanks. That was kinda what I was finding in my searching.
Fred Clown