sysforeignkeys

Transact-SQL Reference

Transact-SQL Reference

sysforeignkeys

Contains information regarding the FOREIGN KEY constraints that are in table definitions. This table is stored in each database.

Column name Data type Description
constid int ID of the FOREIGN KEY constraint.
fkeyid int Object ID of the table with the FOREIGN KEY constraint.
rkeyid int Object ID of the table referenced in the FOREIGN KEY constraint.
fkey smallint ID of the referencing column.
rkey smallint ID of the referenced column.
keyno smallint Position of the column in the reference column list.