Disabling a Check Constraint for Replication

Visual Database Tools

Visual Database Tools

Disabling a Check Constraint for Replication

You can disable a check constraint when your table is replicated in another database. When you replicate a table, the table definition and data are copied from the source database to a destination database. These two databases are usually (but not necessarily) on separate servers. If the check constraints are specific to the source database, they may unnecessarily prevent new data from being entered in the destination database. When you replicate a database at a remote site, you should not reapply check constraints because:

  • The integrity of the data was checked when it was entered into the original database.

  • The replication will fail if data violates the check constraints.

To disable a check constraint for replication

  1. In your database diagram, right-click the table containing the constraint, then select Properties from the shortcut menu.

    -or-

    Open the Table Designer for the table containing the constraint, right-click in the Table Designer, and choose Properties from the shortcut menu.

  2. Choose the Check Constraints tab.

  3. Select the constraint from the Selected constraint list.

  4. Clear the Enforce constraint for replication check box.

See Also

Attaching a New Check Constraint to a Table or Column | Check Constraints | Constraints