All databases include a mechanism for validating input. In a SQL context, CHECK constraints allow you to specify a set of conditions a value must satisfy - for example, Column X should not be larger than Column Y.

Note: You should not use CHECK constraints to check for NULL or enforce a foreign key relationship - there are specific constraints available for those purposes.

This section describes how to configure CHECK constraints for various databases.

In this section

Edit this page on GitHub