对于SQL Server 2000_
对于给定的表“ foo”,我需要一个查询来生成一组表,这些表具有指向foo的外键。
SELECT o2.name FROM sysobjects o INNER JOIN sysforeignkeys fk on o.id = fk.rkeyid INNER JOIN sysobjects o2 on fk.fkeyid = o2.id WHERE o.name = ‘foo’