Aug 27, 2019 01:17 PM|TiredOldCat|LINK
Many thanks for your help. I had one small problem with the query
SELECT A.name AS 'Constraint Name', OBJECT_NAME(B.parent_object_id) AS 'Child Table', D.name AS 'Child Column',
OBJECT_NAME(B.referenced_object_id) AS 'Parent Table', C.name AS 'Parent Column'
FROM sys.foreign_keys AS A INNER JOIN
sys.foreign_key_columns AS B ON A.object_id = B.constraint_object_id INNER JOIN
sys.columns AS C ON B.parent_object_id = C.object_id AND B.parent_column_id = C.column_id INNER JOIN
sys.columns AS D ON B.referenced_object_id = D.object_id AND B.referenced_column_id = D.column_id
WHERE (OBJECT_NAME(B.parent_object_id) = 'MyTable' )
I needed to place ( ) around the WHERE clause. Other than this, worked flawlessly.
Thanks very much for your help.