标签:
1.修改表字段
use EntranceVista; alter table Ry_Stay_Info alter column wza nvarchar(50) alter table Ry_Stay_Info alter column wzb nvarchar(50)
2.添加主键
添加主键之前先要让该字段不能为空
use EveryTouch; alter table FP_TB_Department alter column ID int not null alter table FP_TB_Department add constraint PK_DEPARTMENT primary key (ID)
3.添加自增长
如果一个列已经有主键,要先删除主键,再删除字段,再添加
alter table FP_TB_Department drop constraint PK_DEPARTMENT alter table FP_TB_Department drop column ID alter table FP_TB_Department add ID int identity(1,1) constraint PK_DEPARTMENT primary key (ID)
标签:
原文地址:http://www.cnblogs.com/hongdada/p/4500539.html