CHECK Clause

Use the CHECK clause to designate conditions that must be met before data can be assigned to a column during an INSERT or UPDATE statement.

This syntax fragment is part of the Single-Column Constraint Format and the Multiple-Column Constraint Format.

Read syntax diagramSkip visual syntax diagram
CHECK Clause

                           (1)      
|--CHECK--(--| Condition |------)-------------------------------|

Notes:
  1. See Condition

The condition cannot include a user-defined routine.

During an insert or update, if the check constraint of a row evaluates to false, the database server returns an error. The database server does not return an error if a row evaluates to NULL for a check constraint. In some cases, you might want to use both a check constraint and a NOT NULL constraint.