A Strange Problem with Replication

  • Hi.
    I have 4 Servers doing Merge Repliction between them.
    Everything was working fine till I got one strange problem with on of the servers ( on of the Subscribers ), I have 2 tables related to each other with PK/FK relation .... now if I enter data in the Primary table & insert data related to the master table ,the replicatio agnet deletes the data from the child table & mark these rows as "Conflicts" .... when I checked the reason of this error I found that it is because of the violation of the PK/FK relation which means that the replication agent started replicating the child table without replicating the Master table at first which caused this violation .... anyway I find that the row at the Master table is replicated.
    What caused this behavior ?
    Is there an option in SQL Server Replication agent where I can specify the "Order" of Tables Replication?
    Thanks.
  • Adel,

    In SQL 2K there's no option to specify the order in which tables are replicated. Anyhow what would be right for inserts, will be wrong for deletes. So you either have to create your own scripts or just solve the conflicts.

    SQL2005 has the option to replicate several tables as alogical unit to avoid these kind of errors.

    Markus

    [font="Verdana"]Markus Bohse[/font]

  • You can set the FK's to use the "Not for Replication" option.  This will prevent the FK errors (referential integrity) during replication since replication moves the data in batch's.  It may not be until a subsequent batch for all of the data to arrive.

  • Thanks for your reply.
    The last answer solved my problem.
     
  • you're welcome

Viewing 5 posts - 1 through 4 (of 4 total)

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