--- title: "sys.foreign_keys (Transact-SQL) | Microsoft Docs" ms.custom: "" ms.date: "03/15/2017" ms.prod: "sql-non-specified" ms.reviewer: "" ms.suite: "" ms.technology: - "database-engine" ms.tgt_pltfrm: "" ms.topic: "language-reference" f1_keywords: - "foreign_keys" - "sys.foreign_keys" - "sys.foreign_keys_TSQL" - "foreign_keys_TSQL" dev_langs: - "TSQL" helpviewer_keywords: - "sys.foreign_keys catalog view" ms.assetid: e960df1a-13fc-43ee-ba91-34c1b719ac2c caps.latest.revision: 37 author: "BYHAM" ms.author: "rickbyh" manager: "jhubbard" --- # sys.foreign_keys (Transact-SQL) [!INCLUDE[tsql-appliesto-ss2008-all_md](../../includes/tsql-appliesto-ss2008-all-md.md)] Contains a row per object that is a FOREIGN KEY constraint, with **sys.object.type** = F. |Column name|Data type|Description| |-----------------|---------------|-----------------| |**\**||For a list of columns that this view inherits, see [sys.objects (Transact-SQL)](../../relational-databases/system-catalog-views/sys-objects-transact-sql.md).| |**referenced_object_id**|**int**|ID of the referenced object.| |**key_index_id**|**int**|ID of the key index within the referenced object.| |**is_disabled**|**bit**|FOREIGN KEY constraint is disabled.| |**is_not_for_replication**|**bit**|FOREIGN KEY constraint was created by using the NOT FOR REPLICATION option.| |**is_not_trusted**|**bit**|FOREIGN KEY constraint has not been verified by the system.| |**delete_referential_action**|**tinyint**|The referential action that was declared for this FOREIGN KEY when a delete happens.

0 = No action

1 = Cascade

2 = Set null

3 = Set default| |**delete_referential_action_desc**|**nvarchar(60)**|Description of the referential action that was declared for this FOREIGN KEY when a delete occurs:

NO_ACTION

CASCADE

SET_NULL

SET_DEFAULT| |**update_referential_action**|**tinyint**|The referential action that was declared for this FOREIGN KEY when an update happens.

0 = No action

1 = Cascade

2 = Set null

3 = Set default| |**update_referential_action_desc**|**nvarchar(60)**|Description of the referential action that was declared for this FOREIGN KEY when an update happens:

NO_ACTION

CASCADE

SET_NULL

SET_DEFAULT| |**is_system_named**|**bit**|1 = Name was generated by the system.

0 = Name was supplied by the user.| ## Permissions [!INCLUDE[ssCatViewPerm](../../includes/sscatviewperm-md.md)] For more information, see [Metadata Visibility Configuration](../../relational-databases/security/metadata-visibility-configuration.md). ## See Also [Catalog Views (Transact-SQL)](../../relational-databases/system-catalog-views/catalog-views-transact-sql.md) [Object Catalog Views (Transact-SQL)](../../relational-databases/system-catalog-views/object-catalog-views-transact-sql.md) [Querying the SQL Server System Catalog FAQ](../../relational-databases/system-catalog-views/querying-the-sql-server-system-catalog-faq.md)