sql server 查看指定表约束
select * from sysobjects where parent_obj in( select id from sysobjects where name='student')
sp_mshelpcolumns student
删除约束
alter table tablename drop constraint PK_tablename 去掉
alter table name add constraint pk_tablename primary key clunstered (b)--增加
临时停用约束
禁用: ALTER TABLE table_name NOCHECK CONSTRAINT constraint_name ALTER TABLE table_name NOCHECK CONSTRAINT ALL --禁用所有约束 启用: ALTER TABLE table_name CHECK CONSTRAINT constraint_name ALTER TABLE table_name CHECK CONSTRAINT ALL --启用所有约束