in sql server : 2008
select object_name(referenced_object_id) as [primary table], object_name(parent_object_id) [child table]
from sys.foreign_keys
WHERE object_name(referenced_object_id) ='PatientMaster'
ORDER by object_name(parent_object_id)
in sql server : 2005
select o1.name, o2.name
from sysforeignkeys fk
join sysobjects o1 on o1.id = fk.fkeyid
join sysobjects o2 on o2.id = fk.rkeyid
where o2.name = 'PatientMaster'
11:55 PM |
Category: |
0
comments
Comments (0)