查找指定表的字段not null约束,并生成删除Sql

SElECT 'ALTER TABLE '+OBJECT_NAME(c.parent_obj)+'  DROP CONSTRAINT '+ c.name
FROM sys.sysconstraints a,sys.columns b,sys.sysobjects c
WHERE
a.colid = b.column_id AND a.id = b.object_id AND
b.name in ('upc','ean','isbn') AND c.type = 'D' AND c.id = a.constid

  

上一篇:有序广播和标准广播 --Android开发


下一篇:【iOS】OC-Quartz2D简单使用