Rows Deleting after a FK violation at subscriber

Discussion in 'microsoft.public.sqlserver.replication' started by Joseph, May 26, 2010.

  1. Joseph

    Joseph Guest

    2000 Merge Replication. Publisher, SubscriberA, SubscriberB

    I have a baffling situation I'm hoping someone can shine a little
    light on...Any help would be geratly appreciated! I still haven't
    given up on the newsgroups!

    First I insert into a Primary Key Table. I then "use" these values to
    insert into another table that has an FK constraint on the PK table.

    SubsriberA syncronizes fine, and gets all the data.

    An hour later, SubscriberB tries, and fails. It fails because the PK
    rows aren't there (yet?).

    This seems to start a chain reaction, where upon the next time SubA
    syncs, it deletes the rows in this second table, and that causes them
    to be deleted from the publisher.

    So, two hours later (SubB syncs every hour), the rows from the
    publisher are gone! This worries me greatly, as to what else can be
    deleted.

    Does anyone know why the PK inserts may be failing, or occuring out of
    order?
    Does anyone know how to monitor for this stuff? IE, I still can't
    find out where these error messages (FK violations) are being stored
    in the case of Replication.

    Thanks in Advance!!
     
    Joseph, May 26, 2010
    #1
    1. Advertisements

  2. Joseph

    Paul Ibison Guest

    Have a look at the conflict viewer to see if the PK records are being rolled
    back due to a compensating change. if not, then check that the PK/FK
    relationship is declared on the publisher - this will determine the order
    (via nicknames) of application of these changes at the subscriber.
    HTH,
    Paul Ibison
     
    Paul Ibison, Jun 15, 2010
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.