• binutb - Wednesday, June 20, 2018 7:24 AM

    Hi,

    How to find the entire table list in the order of Foreign  key reference in a database

    ie. Parent table first, then Child table

    Regards
    Binu

    You can query sys.foreign_keys to get that information:
    SELECT
        [name] ConstraintName,
        OBJECT_NAME(parent_object_id) ReferencingTable,
        OBJECT_NAME (referenced_object_id) ReferencedTable
    FROM sys.foreign_keys

    Sue