CHECK_CONSTRAINTS view

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

Columns

Column Name

Data Type

Description

CONSTRAINT_CATALOG

VARCHAR

Database that the CHECK constraint belongs to.

CONSTRAINT_SCHEMA

VARCHAR

Schema that the CHECK constraint belongs to.

CONSTRAINT_TABLE

VARCHAR

Table or view that the CHECK constraint belongs to.

CONSTRAINT_NAME

VARCHAR

Name of the constraint with the CHECK clause.

CHECK_CLAUSE

VARCHAR

Condition 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;