Triynko
Triynko

Reputation: 19204

Can I remove the "not for replication" option from an existing check constraint in T-SQL?

Suppose a check constraint (involving multiple columns) with the "not for replication" option was added to a database table (e.g. "alter table table_name add constraint constraint_name check not for replication (constraint_expression)")

I found syntax for dropping "not for replication" from a column, but not for an existing check constraint as mentioned above.

Is there a way to remove the "not for replication" from the check constraint other than dropping/recreating the check constraint?

Upvotes: 2

Views: 3274

Answers (1)

MikeW
MikeW

Reputation: 5922

I'm almost certain you have to drop and recreate it without the "not for replication" option.

You can alter columns but I don't think you can alter constraints.

Upvotes: 2

Related Questions