Sql 语句添加字段、修改字段类型、默认值语法

Sql 语句添加字段

alter table 表名  add 字段名 decimal(10,1) default 0 not null
--修改类型
alter Table  bbs
alter column  title varchar(400)

 

Sql 语句修改默认值

alter table 表名 drop constraint 约束名字 --删除字段约束
alter table attachment add constraint DF_Attachment_threadid DEFAULT ((0)) for threadid --添加默认值约束

 

posted @ 2015-11-27 15:21  Mr. Hu  阅读(2493)  评论(0编辑  收藏  举报
Map