Reinitialising a subscription with constraints on the subscriber table

  • I've only started working with replication recently so this might seem like a fairly basic question!

    I am using transactional replication to update a table on a number of subscribers. All the columns of the table are published but there is a simple row filter which checks that the value of a certain field is above zero. The Name Conflicts properties of the subscriptions are set so that if the table exists at the subscriber, the data that matches the row filter is deleted.

    A new column (of type timestamp) was added to the table at one of the subscribers, and the first I knew of it was when replication started failing for that subscriber because the number of columns didn't match.

    I have fixed this but if I try to reinitialise the subscription, it fails as there are foreign key constraints in the subscriber database preventing replication from deleting the data in the replicated table.

    Do I need to remove the constraints before replication and add them back in afterwards to allow reinitialisation to run or is there another way around it?

    I'm not sure if I've given enough background information but I'm happy to provide anything I may have left out.

    Thanks.

    Edit: Forgot to say, the Publisher and Distributor are both on SQL2000 SP4 and the subscribers are all on SQL7 SP4.

  • One option to try would be to turn off the "Enforce constraint for replication" (constraint) attribute and / or the "Enforce relationship for replication" (Relationship) attribute

    Mark

     

  • Thanks, setting the "Enforce constraint for replication" option seems to have done the trick!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply