1.表上增加字段

use [TEST]
go
alter table SalesContract add 
   Creater varchar(20) ,
   CreateTime datetime ,
   UpdateBy varchar(20) null,
   UpdateTime datetime null
go

 2.修改列名和列的类型

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。
EXEC sp_rename '表名.[字段旧名]', '字段新名' , 'COLUMN';

exec sp_rename 'Test1.[BINM]','BINM1','COLUMN'

alter table 表名 alter column 字段名 decimal(18, 2) null;

alter table Test1 alter column BINM1 varchar(50) not null

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄