If you ever find yourself in the situation where you need to re-enable a CHECK
constraint that has previously been disabled, you should definitely make sure that you know what you’re doing.
In particular, you should understand the difference between WITH NOCHECK
and WITH CHECK
arguments.
These arguments can be used at the time you enable the constraint. They specify whether or not existing data is validated against your re-enabled (or newly added) CHECK
constraint. Basically you have the option of checking all existing data for any violations against the constraint. If you don’t specify anything, existing data won’t be checked. That’s why it’s important to understand how it works.
By the way, these arguments also apply to foreign key constraints.