-
I have some master tables that other tables reference their PK as a forign key. Good example is "Cities" tables that can be referenced from "Customers" and "Suppliers" tables.
Now, the question is, is there a away to get a list of those tables that reference "Cities" ??
I'm using SQL server 7.0, ADO 2.5
Regards
-
exec sp_depends 'tablename'
Roger
-
Ok, I found the answer in another site, here it is:
SELECT Name FROM SYSOBJECTS,SYSREFERENCES
WHERE ID = FKEYID
AND RKEYID = (SELECT ID FROM sysobjects WHERE Name = TableName