Enforcing Data Integrity Using Check Constraints

From ER/Studio Data Architect
Jump to: navigation, search

Go Up to Customizing the Data Model

The Check constraint evaluates the data as it is entered and only if the check evaluates to true is the entry allowed. The constraint entered for an entity is used when creating the physical model and can be seen in the table's DDL.

  1. Double-click the entity or table you want to create a check constraint for.
  2. On the Rule/Constraints tab of the Entity or Table Editor, name the constraint and then enter the constraint in the text box.

The constraint is added to the CREATE TABLE statement in the Table's DDL in the format:

CONSTRAINT ( constraint_name ) CHECK ( constraint_text )

where

constraint_name is the name of the constraint

constraint_text is the text entered in the text box


See Also