已知表名,如何获取该表的依赖表?
RT
[解决办法]
exec sp_depends '已知表名'
[解决办法]
如果查外健关系:
create table t1(ID int primary key )
create table t2(ID int constraint FK_t2 foreign key references t1(ID))
select
object_name(fkeyID),object_name(rkeyID)
from
sysforeignkeys
where
fkeyID=object_id( 't2 ')