SQL-statement wich shows all foreign keys

  • Thread starter Thread starter Dieter Drescher
  • Start date Start date
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.
 
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).
 
It works!

Thank you very much for your help.

******************************************************************
 
Back
Top