Need listing of all relationships of tables SQL Server 2017
This will get all relations discoverable through FK constraints for a database:
USE &lt;your database&gt;
GO

SELECT
  ChildSchema.name AS ChildSchema
 ,Child.name AS ChildTable  
 ,fk.name
 ,ParentSchema.name AS ParentSchema
 ,Parent.name AS ParentTable
FROM
 sys.foreign_keys FK
INNER JOIN
  sys.tables Child
    ON Child.object_id = FK.parent_object_id --Parent here means the &quot;parent&quot; of the FK, not the relation
INNER JOIN
  sys.schemas ChildSchema
    ON ChildSchema.schema_id = Child.schema_id
INNER JOIN
  sys.tables Parent
    ON Parent.object_id = FK.referenced_object_id
INNER JOIN
  sys.schemas ParentSchema
    ON ParentSchema.schema_id = Parent.schema_id
ORDER BY 
  ChildSchema.name
 ,Child.name
GO