Modifying a Check Constraint

Modify a check constraint when you want to change the constraint expression or the options that enable or disable the constraint for specific conditions.

To modify a check constraint

  1. In your database diagram, select the table whose check constraint you want to modify.

  2. Right-click the table and select Properties.

  3. Choose the Tables tab.

  4. Select the constraint you want to change from the Selected constraint list.

  5. Complete an action from the following table:

    Note   Some databases have different functionality for check constraints. For more information about the differences between databases, see Database Server Considerations. Consult your database documentation for details about how your database works with check constraints.

    To Follow these steps
    Edit the constraint expression Type the new expression in the Constraint expression box. For details, see Defining a Check Constraint Expression.
    Rename the constraint Type a new name in the Constraint name box. Make sure that your new name doesn’t duplicate a name in the Selected constraint list.
    Apply the constraint to existing data (Microsoft SQL Server only) Select the Check existing data on creation option. For details, see Checking Existing Data When Creating a Check Constraint.
    Disable the constraint when new data is added to the table or when existing data is updated in the table (Microsoft SQL Server only) Clear the Enable constraint for INSERT and UPDATE option. For details, see Disabling a Check Constraint with INSERT and UPDATE Statements.
    Disable the constraint when the table is replicated in another database(Microsoft SQL Server only) Clear the Enable constraint for replication option. For details, see Disabling a Check Constraint for Replication.

The constraint is updated in the database when you save your table or diagram.