如何用sql语句删除默认约束

来源:互联网 发布:电脑淘宝卖家中心在哪 编辑:程序博客网 时间:2024/04/29 10:31

 查询约束名

select b.name from syscolumns a,sysobjects b where a.id=object_id('表名') and b.id=a.cdefault and a.name='字段名' and b.name like 'DF%'

删除约束

alter table 表名 drop constraint 约束名

原创粉丝点击