Pages

Friday, May 30, 2014

How to determine foreign key of a database - TIP #8


To determine foreign key of the database we need to run following command

Go
SELECT NAME,
OBJECT_NAME(Parent_Object_Id) As PrimaryTable,
object_Name(Referenced_Object_Id) As ReferenceTable,
create_Date,
Modify_Date
FROM sys.Foreign_Keys
WHERE type ='F'
GO



Enjoy!!!

No comments:

Post a Comment