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!!!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

code