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,

posted on 2017-05-25 14:56  hehedada  阅读(179)  评论(0编辑  收藏  举报

导航