0

I'm new to replication and would like to know the impact of creating a check constraint on a publisher table both in case of merge replication and transaction repl.

Both the cases, repl is already setup, would the replication break if I set up the check the constraint or would I need to re-initialize the subs after creating the check constraint.

Please let know what are precautionary steps I need to take

 ALTER TABLE [dbo].[table]  WITH CHECK ADD  CONSTRAINT xx CHECK ()
 GO

 ALTER TABLE [dbo].[table] CHECK CONSTRAINT [xx]
 GO 

Thanks

Java Devil
  • 10,629
  • 7
  • 33
  • 48
user2537249
  • 41
  • 3
  • 7

2 Answers2

0

The replication will not break because of this change. I normally don't work with merge replication but confirmed adding a check constraint does not break merge replication either. You might consider using the NOT FOR REPLICATION command line if you don't want the constraint replicated and enforced on the subscriber. I like to control this at the publisher level.

Russ960
  • 1,109
  • 2
  • 17
  • 33
0

For existing publications you can view the properties to see if CHECK CONSTRAINTS are published to the subscriber.

Right Click - Properties - Articles - Set Properties of Highlighted Article.

If it's false, you don't need to worry about it being pushed to the subscriber.

Properties viewed using SSMS on Publisher

gareth
  • 199
  • 1
  • 3