sqlserver 创建字段 修改字段名称 设置字段默认值


--创建不为空列
alter table 表名 add 列名 int not null default 0
go
--删除字段
alter table 表名 drop column 列名
go
--修改列名称
exec sp_rename '表名.列名','新名称'

 字段设置默认值

alter table 表名 add default (0) for 列名  with values   
SQL