문제

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

도움이 되었습니까?

해결책

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top