Replication doesnt copy check and default constraints RRS feed

  • Question

  • Hi,

    i'm trying to create a transactional replication from DB A to DB B. Definition of A and B are the same, and i want to keep the B database with all the indexes, constraints, keys, ...

    But after the snapshot is done, some of the constraints disappear. In Article properties, i set the "Copy default value specifications" and "Copy check constraints" to true. However, check constraints are removed from subscription DB and also some of the default constraints. I noticed, replication keep only constraints with constant default value (for example 0). If the value is function, its gone. The function exists in both databases, so i think, there is no problem with keep this constraints in subscription database.

    I'm using latest SQL Server 2016 (developer edition).

    Is this a bug, or a normal behavior?

    Wednesday, October 5, 2016 8:35 AM


All replies

  • I think this is by design. Basically all the DML is supposed to originate at the publisher where the constraints are enforced. There is no need to also enforce them at the subscriber.

    However, can you provide me with an example so I can attempt a repro?

    Wednesday, October 5, 2016 2:21 PM
  • "by design"

    So why is it that my transactional replication "hangs" due to trying to create check constraints on the subscriber that reference functions that only exist on publisher? I have "Copy check constraints" off, should I try turning it on? 

    Running SQL Server 2016 Developer edition 13.0.4001.0.

    Tuesday, August 20, 2019 6:45 PM