SYSCONSTRAINTS System Table

The SYSCONSTRAINTS table describes the information common to all types of constraints within the current database (currently, this includes primary key, unique, and check constraints).

The following table shows the contents of the SYSCONSTRAINTS system table.

SYSCONSTRAINTS system table
Column Name Type Length Nullable Contents
CONSTRAINTID CHAR 36 NO Unique identifier for constraint
TABLEID CHAR 36 NO Identifier for table (join with SYSTABLES.TABLEID)
CONSTRAINTNAME VARCHAR 128 NO Constraint name (internally generated if not specified by user)
TYPE CHAR 1 NO

Possible values:

  • 'P' for primary key)
  • 'U' for unique)
  • 'C' for check)
SCHEMAID CHAR 36 NO Identifier for schema that the constraint belongs to (join with SYSSCHEMAS.SCHEMAID)
STATE CHAR 1 NO

Possible values:

  • 'E' for enabled
  • 'D' for disabled
REFERENCECOUNT INTEGER 10 NO The count of the number of foreign key constraints that reference this constraint; this number can be greater than zero only or PRIMARY KEY and UNIQUE constraints

See Also