Tuesday, 3 January 2012

Foreign key references in Database

We can find the all the foreign key references by this in current database

SELECT a.name FKey,

               OBJECT_NAME(a.parent_object_id) ParentTable,

               OBJECT_NAME(a.referenced_object_id) RefTable

FROM   sys.foreign_keys a

 

Posted by: MR. JOYDEEP DAS

 

1 comment: