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 --添加默认值约束
原文地址:https://www.cnblogs.com/huhangfei/p/5000796.html