• How to find out all foreign key relationship referencing table in SQL Server

    Posted on August 14, 2013 by in SQL Tips & Tricks, Tips & Tricks

    SELECT object_name([parent_object_id]) AS Referencing_Table_Name, 
    [name] AS FOREIGN_KEY_NAME, 
    object_name(referenced_object_id) AS Referenced_Table_Name, *
    FROM sys.foreign_keys
    WHERE referenced_object_id = object_id('Production.Product')
    

    foreign key relationship

    Be Sociable, Share!
      Post Tagged with , ,

    Written by

    View all articles by

    Email : [email protected]

    Leave a Reply