SQL Server新增表列,修改表列,删除表列

新增列:

alter table t1 add c1 int not null constraint [df_t1_c1] default ((0))

 

修改列:

alter table t1 alter column c1 DECIMAL(18,4) --修改列类型

alter table t1 drop constraint [df_t1_c1]--删除约束

 

删除列:

alter table t1 drop constraint df_t1_c1--约束名
alter table t1 drop column c1

posted @ 2021-05-14 09:53  ittalk  阅读(153)  评论(0)    收藏  举报