sysconstraints

Applies to all databases. Whenever a user declares a new check constraint or referential constraint using create table or alter table, the SAP ASE 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.

This table also contains one row for each check constraint, referential constraint, rules, computed column, multiple triggers, and function-based index key associated with a specific table.

Columns

The columns for sysconstraints are:

Name

Datatype

Description

colid

smallint

Column number in the table

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
  • 0x0100 = a computed column object constraint
The status of triggers:
  • 0x0080 = a delete trigger
  • 0x0100 = an insert trigger
  • 0x0200 = an update trigger
  • 0x0400 = trigger is disabled

spare2

int

Unused

Indexes

  • Unique clustered index on tableid, colid

  • Nonclustered index on constrid