Skip to content

Latest commit

 

History

History
46 lines (40 loc) · 1.99 KB

File metadata and controls

46 lines (40 loc) · 1.99 KB
title sys.sysconstraints (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 03/15/2017
ms.prod sql
ms.prod_service database-engine
ms.reviewer
ms.technology system-objects
ms.topic language-reference
f1_keywords
sysconstraints
sys.sysconstraints
sysconstraints_TSQL
sys.sysconstraints_TSQL
dev_langs
TSQL
helpviewer_keywords
sys.sysconstraints compatibility view
sysconstraints system table
ms.assetid f2b2e2ad-ba24-48a1-913c-8ee4e0895dc4
author rothja
ms.author jroth

sys.sysconstraints (Transact-SQL)

[!INCLUDEtsql-appliesto-ss2012-xxxx-xxxx-xxx-md]

Contains mappings of constraints to the objects that own the constraints within the database.

Important

[!INCLUDEssnoteCompView]

Column name Data type Description
constid int Constraint number.
id int ID of the table that owns the constraint.
colid smallint ID of the column on which the constraint is defined.

0 = Table constraint
spare1 tinyint Reserved
status int Pseudo-bit-mask indicating the status. Possible values include the following:

1 = PRIMARY KEY constraint

2 = UNIQUE KEY constraint

3 = FOREIGN KEY constraint

4 = CHECK constraint

5 = DEFAULT constraint

16 = Column-level constraint

32 = Table-level constraint
actions int Reserved
error int Reserved

See Also

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