Can I remove the “not for replication” option from an existing check constraint in T-SQL?
-
16-09-2019 - |
Question
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?
Solution
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow