日期:2014-05-18  浏览次数:20459 次

请教条查询关联名称的sql语句
我添加个表关联,
alter   Table   IDP_DomainRelation   add   constraint   PK_DomainO   foreign   key(Name)
请问下怎样把   constraint   的名称 "PK_DomainO "通过sql语句查出来呢?

------解决方案--------------------
http://blog.csdn.net/sxycgxj/archive/2005/09/29/492208.aspx
------解决方案--------------------
select * from sysobjects where xtype= 'f ' and parent_obj=object_id( 'IDP ')
------解决方案--------------------
SELECT a.name AS PK, b.name AS NAME
FROM sysobjects a INNER JOIN
sysobjects b ON a.parent_obj = b.id
WHERE (a.xtype = 'pk ') AND b.name = 'IDP_DomainRelation '
------解决方案--------------------
学习.

------解决方案--------------------
学习