sysconstraints

All databases

Description

sysconstraints has one row for each referential constraint and check constraint associated with a table or column.

Whenever a user declares a new check constraint or referential constraint using create table or alter table, Adaptive Server inserts a row into the sysconstraints table. The row remains until a user executes alter table to drop the constraint. Dropping a table by executing drop table removes all rows associated with that table from the sysconstraints table.

Columns

The columns for sysconstraints are:

Name

Datatype

Description

colid

smallint

Column number in the table

spare1

tinyint

Unused

constrid

int

Object ID of the constraint

tableid

int

ID of the table on which the constraint is declared

error

int

Constraint specific error message

status

int

The type of constraint:

  • 0x0040 = a referential constraint

  • 0x0080 = a check constraint

spare2

int

Unused

Indexes

Clustered index On tableid, colid

Unique nonclustered index On constrid