几乎与
Query a Table’s Foreign Key relationships相同,但对于sql Server 2000
解决方法
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'
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'