CHECK_CONSTRAINTS view

This Information Schema view displays a row for each CHECK constraint defined in the specified or current database.

Columns

Column NameData TypeDescription
CONSTRAINT_CATALOGVARCHARDatabase that the CHECK constraint belongs to.
CONSTRAINT_SCHEMAVARCHARSchema that the CHECK constraint belongs to.
CONSTRAINT_TABLEVARCHARTable or view that the CHECK constraint belongs to.
CONSTRAINT_NAMEVARCHARName of the constraint with the CHECK clause.
CHECK_CLAUSEVARCHARCondition enforced by the CHECK constraint.

Usage notes

The view only displays objects for which the current role for the session has been granted access privileges.

Examples

Retrieve all of the CHECK constraints applied to tables in the mydb database:

USE DATABASE mydb;

SELECT * FROM INFORMATION_SCHEMA.CHECK_CONSTRAINTS;