SELECT [ro].[name] [PKtable], [rc].[name] [PKcolumn], [po].[name] [FKtable], [pc].[name] [FKcolumn], [fk].[name] [FKname] FROM [sys].[foreign_keys] [fk] INNER JOIN [sys].[all_objects] [po] ON [po].[object_id] = [fk].[parent_object_id] INNER JOIN [sys].[all_objects] [ro] ON [ro].[object_id] = [fk].[referenced_object_id] INNER JOIN [sys].[foreign_key_columns] [fkc] ON [fkc].[constraint_object_id] = [fk].[object_id] AND [fkc].[parent_object_id] = [fk].[parent_object_id] AND [fkc].[referenced_object_id] = [fk].[referenced_object_id] INNER JOIN [sys].[columns] [pc] ON [pc].[object_id] = [fk].[parent_object_id] AND [pc].[column_id] = [fkc].[parent_column_id] INNER JOIN [sys].[columns] [rc] ON [rc].[object_id] = [fk].[referenced_object_id] AND [rc].[column_id] = [fkc].[referenced_column_id] ORDER BY [ro].[name], [rc].[name], [po].[name], [pc].[name]
Including object schema:
SELECT [rs].[name] [PKschema], [ro].[name] [PKtable], [rc].[name] [PKcolumn], [ps].[name] [FKschema], [po].[name] [FKtable], [pc].[name] [FKcolumn], [fk].[name] [FKname] FROM [sys].[foreign_keys] [fk] INNER JOIN [sys].[all_objects] [po] ON [po].[object_id] = [fk].[parent_object_id] INNER JOIN [sys].[schemas] [ps] ON [ps].[schema_id] = [po].[schema_id] INNER JOIN [sys].[all_objects] [ro] ON [ro].[object_id] = [fk].[referenced_object_id] INNER JOIN [sys].[schemas] [rs] ON [rs].[schema_id] = [ro].[schema_id] INNER JOIN [sys].[foreign_key_columns] [fkc] ON [fkc].[constraint_object_id] = [fk].[object_id] AND [fkc].[parent_object_id] = [fk].[parent_object_id] AND [fkc].[referenced_object_id] = [fk].[referenced_object_id] INNER JOIN [sys].[columns] [pc] ON [pc].[object_id] = [fk].[parent_object_id] AND [pc].[column_id] = [fkc].[parent_column_id] INNER JOIN [sys].[columns] [rc] ON [rc].[object_id] = [fk].[referenced_object_id] AND [rc].[column_id] = [fkc].[referenced_column_id] ORDER BY [ro].[name], [rc].[name], [po].[name], [pc].[name]