declare @csname varchar(100)set @csname=''
select @csname=[name] --约束名称from sysobjects twhere id=(select cdefault from syscolumns where id=object_id(N'表名') and name='字段名')
--动态删掉约束exec('alter table 表名 drop constraint '+@csname)
--动态禁用约束exec ('alter table 表名 nocheck constraint ' + @csname)
--动态启用约束exec ('alter table 表名 check constraint ' + @csname)