create table 学生表( sdpet char(10) ) alter table 学生表 add constraint DF default ('aa') for sdpet
sqlserver 2000中有这样的语法吗?
default <约束名> <默认值> for <列名> sqlserver 2000中有上述的语法吗?教材上是这么写的
create table 学生表( id int, sdpet char(10) ) go CREATE DEFAULT de_sdpet AS 'aa' go exec sp_bindefault 'de_sdpet', '学生表.sdpet'; goinsert into 学生表 (id) select 1select * from 学生表
create table 学生表(
sdept char(10) default('aa')
)
DEFAULT 定义可以包含常量值、函数、SQL-92 niladic 函数或 NULL
DEFAULT 定义中的 constant_expression 不能引用表中的其它列,也不能引用其它表、视图或存储过程。
不能在数据类型为 timestamp 的列或具有 IDENTITY 属性的列上创建 DEFAULT 定义。
如果用户定义数据类型绑定到默认对象,则不能在该用户定义数据类型的列上创建 DEFAULT 定义
sdpet char(10)
)
alter table 学生表
add constraint DF default ('aa') for sdpet
sqlserver 2000中有上述的语法吗?教材上是这么写的
id int,
sdpet char(10)
)
go
CREATE DEFAULT de_sdpet AS 'aa'
go
exec sp_bindefault 'de_sdpet', '学生表.sdpet';
goinsert into 学生表 (id) select 1select * from 学生表