代码改变世界

SQL语句查询表中的所有约束

2017-04-07 09:57  小猫爱吃清蒸鱼  阅读(7264)  评论(0编辑  收藏  举报

 

select * from sysobjects where parent_obj in(select id from sysobjects where name='表名')

 

或者

 

exec sp_helpconstraint @objname='表名'