If you use the MODIFY clause to add a constraint in the enabled mode and receive an error message because existing rows would violate the constraint, take the following steps to add the constraint successfully:
Issue the ALTER TABLE statement again, but this time specify the DISABLED keyword in the MODIFY clause.
When you issue this statement, existing rows in the target table that violate the constraint are duplicated in the violations table; however, you receive an integrity-violation error message, and the constraint remains disabled.
You might need to join the violations and diagnostics tables to get all the necessary information.
Now the constraint is enabled, and no integrity-violation error message is returned because all rows in the target table now satisfy the new constraint.