SQL-statement wich shows all foreign keys

D

Dieter Drescher

Hello,

is it possible to generate a SQL-satement in MS-SQL which shows all
foreign keys relationships in a database?

Thanks in advance for any suggestions.
 
J

John Vinson

Hello,

is it possible to generate a SQL-satement in MS-SQL which shows all
foreign keys relationships in a database?

Thanks in advance for any suggestions.

SELECT szRelationship, szColumn, szObject, szReferencedColumn,
szReferencedObject FROM MSYSRelationships;

Note that this table structure is undocumented and there's no
guarantee that this will work in any version other than A2002 (which I
used to construct it).
 
D

Dieter Drescher

It works!

Thank you very much for your help.

******************************************************************
 
Top