由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - 请教如何用alter table 来加一个not null的列
相关主题
another question--怎么delete a row from a tableHow to insert image to DB2 ?
How to delete column and row in tableMS SQL Server 2k question
有包子!sql procedure 来rank不同table里面的数据如何only update the first occurrence in a table
MS SQL怎么加conditional check求助:sql server 2000, 这句话怎么写?
SQL Server Trigger on System Base Table or Catalog View[转载] what's wrong with this PL/SQL
请教三个Key的property,jdbc to db2 on linux问题
primary key?How to load data into Mysql from txt file?
如何用SQL语句判断一个TABLE是否存在?the most stupid question
相关话题的讨论汇总
话题: null话题: alter话题: table话题: tmp话题: 来加
进入Database版参与讨论
1 (共1页)
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

1 (共1页)
进入Database版参与讨论
相关主题
the most stupid questionSQL Server Trigger on System Base Table or Catalog View
sql server 2k DTS 问题 请教请教三个Key的property,
How to find primary keyprimary key?
sql question?如何用SQL语句判断一个TABLE是否存在?
another question--怎么delete a row from a tableHow to insert image to DB2 ?
How to delete column and row in tableMS SQL Server 2k question
有包子!sql procedure 来rank不同table里面的数据如何only update the first occurrence in a table
MS SQL怎么加conditional check求助:sql server 2000, 这句话怎么写?
相关话题的讨论汇总
话题: null话题: alter话题: table话题: tmp话题: 来加