1.查询表所有字段的属性:
SELECT * From INFORMATION_SCHEMA.COLUMS Where
TABLE_SCHEMA= '库名' AND TABLE_NAME = '表名'
2.新增表字段:
alter table 表名 add 字段名称 类型 not null
3.修改表字段属性:
alter table 表名 alter column 字段名称 类型 not null
4.修改表名
EXEC sp_rename '原表名', '新表名'
5.修改字段名
EXEC sp_rename '表名.原字段名','新字段名'
6.删除字段
alter table 表名 drop column 字段名