sys.sysreferences (Transact-SQL)

Applies to: SQL Server Azure SQL Managed Instance Azure Synapse Analytics Analytics Platform System (PDW) SQL analytics endpoint in Microsoft Fabric Warehouse in Microsoft Fabric

Contains mappings of the FOREIGN KEY constraint definitions to the referenced columns within the database.

Important

This SQL Server 2000 system table is included as a view for backward compatibility. We recommend that you use the current SQL Server system views instead. To find the equivalent system view or views, see Mapping System Tables to System Views (Transact-SQL). This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

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) Identified for informational purposes only. Not supported. Future compatibility is not guaranteed.
refkeys varbinary(32) Identified for informational purposes only. Not supported. Future compatibility is not guaranteed.
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.

See Also

Mapping System Tables to System Views (Transact-SQL)
Compatibility Views (Transact-SQL)