SQL语句 表字段的操作 添加,删除,修改表的字段

alter table 表名

drop constraint 约束名字   //删除字段的原有约束

alter table 表名

add constraint 约束名字 DEFAULT 默认值 for 字段名称 //添加一个表的字段的约束并指定默认值

alter table 表名

rename column A to B  //修改字段名

alter table 表名

modify column UnitPrice decimal(18, 4) not null  //修改字段类型

alter table 表名 

ADD 字段 类型 NOT NULL Default 0 ,

       字段 类型 NOT NULL Default 0,

原文地址:https://www.cnblogs.com/weiying/p/weiying_2017_05_25.html