查找外键引用的表
--下面语句去掉where条件的话是所有的外键关系
select t1.* ,t2.name,t3.name
from dbo.sysforeignkeys t1 left join sysobjects t2 on t1.fkeyid = t2.id
left join sysobjects t3 on t1.rkeyid = t3.id
where t3.name = 'tablename '
select t1.* ,t2.name,t3.name
from dbo.sysforeignkeys t1 left join sysobjects t2 on t1.fkeyid = t2.id
left join sysobjects t3 on t1.rkeyid = t3.id
where t3.name = 'tablename '