sysreferences

Transact-SQL Reference

Transact-SQL Reference

sysreferences

Contains mappings of FOREIGN KEY constraint definitions to the referenced columns. This table is stored in each database.

Column name Data type Description
constid int ID of the FOREIGN KEY constraint
fkeyid int ID of the referencing table
rkeyid int ID of the referenced table
rkeyindid smallint Index ID of the unique index on the referenced table covering the referenced key-columns
keycnt smallint Number of columns in the key
forkeys varbinary(32) For internal use only
refkeys varbinary(32) For internal use only
fkeydbid smallint Reserved
rkeydbid smallint Reserved
fkey1 smallint Column ID of the referencing column
fkey2 smallint Column ID of the referencing column
fkey3 smallint Column ID of the referencing column
fkey4 smallint Column ID of the referencing column
fkey5 smallint Column ID of the referencing column
fkey6 smallint Column ID of the referencing column
fkey7 smallint Column ID of the referencing column
fkey8 smallint Column ID of the referencing column
fkey9 smallint Column ID of the referencing column
fkey10 smallint Column ID of the referencing column
fkey11 smallint Column ID of the referencing column
fkey12 smallint Column ID of the referencing column
fkey13 smallint Column ID of the referencing column
fkey14 smallint Column ID of the referencing column
fkey15 smallint Column ID of the referencing column
fkey16 smallint Column ID of the referencing column
rkey1 smallint Column ID of the referenced column
rkey2 smallint Column ID of the referenced column
rkey3 smallint Column ID of the referenced column
rkey4 smallint Column ID of the referenced column
rkey5 smallint Column ID of the referenced column
rkey6 smallint Column ID of the referenced column
rkey7 smallint Column ID of the referenced column
rkey8 smallint Column ID of the referenced column
rkey9 smallint Column ID of the referenced column
rkey10 smallint Column ID of the referenced column
rkey11 smallint Column ID of the referenced column
rkey12 smallint Column ID of the referenced column
rkey13 smallint Column ID of the referenced column
rkey14 smallint Column ID of the referenced column
rkey15 smallint Column ID of the referenced column
rkey16 smallint Column ID of the referenced column