sysreferences (all databases)

Contains mappings of FOREIGN KEY constraint definitions.

Column Datatype Description
constid int Constraint ID
fkeyid int ID of referencing table
fkeydbid smallint Reserved
rkeyid int ID of referenced table
rkeydbid smallint Reserved
rkeyindid smallint Reserved
keycnt smallint Number of columns in key
fkey1 tinyint Column ID of referencing column
fkey2 tinyint Column ID of referencing column
fkey3 tinyint Column ID of referencing column
fkey4 tinyint Column ID of referencing column
fkey5 tinyint Column ID of referencing column
fkey6 tinyint Column ID of referencing column
fkey7 tinyint Column ID of referencing column
fkey8 tinyint Column ID of referencing column
fkey9 tinyint Column ID of referencing column
fkey10 tinyint Column ID of referencing column
fkey11 tinyint Column ID of referencing column
fkey12 tinyint Column ID of referencing column
fkey13 tinyint Column ID of referencing column
fkey14 tinyint Column ID of referencing column
fkey15 tinyint Column ID of referencing column
fkey16 tinyint Column ID of referencing column
rkey1 tinyint Column ID of referenced column
rkey2 tinyint Column ID of referenced column
rkey3 tinyint Column ID of referenced column
rkey4 tinyint Column ID of referenced column
rkey5 tinyint Column ID of referenced column
rkey6 tinyint Column ID of referenced column
rkey7 tinyint Column ID of referenced column
rkey8 tinyint Column ID of referenced column
rkey9 tinyint Column ID of referenced column
rkey10 tinyint Column ID of referenced column
rkey11 tinyint Column ID of referenced column
rkey12 tinyint Column ID of referenced column
rkey13 tinyint Column ID of referenced column
rkey14 tinyint Column ID of referenced column
rkey15 tinyint Column ID of referenced column
rkey16 tinyint Column ID of referenced column

Index

ucsysreferences clustered unique on constid

nc1sysreferences nonclustered fkeyid

nc2sysreferences nonclustered rkeyid

Referenced by Stored Procedures

sp_fkeys sp_helpconstraint