S**n 发帖数: 11 | 1 【 以下文字转载自 swan 的信箱 】
【 原文由 swan 所发表 】
sql server 不支持直接的
alter table tableName
add anewcolumn columnType not null
这样的形式。
有alternative的法子吗?
谢! |
f***g 发帖数: 10 | 2 should define a deault not null value, example:
create table #tmp (aaa int not null primary key)
insert into #tmp values(1)
insert into #tmp values(2)
alter table #tmp
add bbb int default 0 not null
the statement
"alter table #tmp
add ccc int not null"
will fail
【在 S**n 的大作中提到】 : 【 以下文字转载自 swan 的信箱 】 : 【 原文由 swan 所发表 】 : sql server 不支持直接的 : alter table tableName : add anewcolumn columnType not null : 这样的形式。 : 有alternative的法子吗? : 谢!
|
S**n 发帖数: 11 | 3 非常感谢,问题解决。:)
【在 f***g 的大作中提到】 : should define a deault not null value, example: : create table #tmp (aaa int not null primary key) : insert into #tmp values(1) : insert into #tmp values(2) : alter table #tmp : add bbb int default 0 not null : the statement : "alter table #tmp : add ccc int not null" : will fail
|