Insert or update operations that are not correct occur when you synchronize a SQL Server CE subscriber with a publisher (823545)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)
  • Microsoft SQL Server 2000 Windows CE Edition 2.0

Bug #: 469724 (SQL Server 8.0)
SQL Server 8.0:469724

SYMPTOMS

When you synchronize a Microsoft SQL Server 2000 Windows CE Edition subscriber with a publisher in a merge publication, the data from the subscriber that is already synchronized with the publisher is inserted or is updated on the publisher. This problem occurs if all the following conditions are true:
  • The subscription type is not anonymous.
  • Merge join filters are defined for the replication.
  • Referential integrities are defined in the publication database on the articles that are part of the publication.

CAUSE

The problem occurs because the referential integrities that are defined on the articles in the publisher database conflict with the merge join filters.

WORKAROUND

To work around this problem, follow these steps:
  1. Create the publisher database without defining referential integrities on the articles.
  2. Create the publication, and then add the tables that are used as articles and the tables that are used to define the join filters in the same order.
  3. Update the database.
  4. Create the snapshot of the publication that has referential integrity without using the NOT FOR REPLICATION option. To do so, edit the Snapshot Agent that is created for the publication, and then follow these steps:
    1. Insert a step before the Run Agent step to define the referential integrity on the articles in the publisher database without using the NOT FOR REPLICATION option.
    2. Insert a step after the Run Agent step to drop the previously defined referential integrity and to define referential integrity using the NOT FOR REPLICATION option on the articles in the publisher database.
    3. Edit the Run Agent step.
    4. Click the Advanced tab, and then click Go to next step in the OnSuccess action list.

REFERENCES

For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base:

307356 INF: Understanding merge replication article processing order

307482 PRB: Foreign key conflicts at merge subscriber result in DELETE during next upload


Modification Type:MinorLast Reviewed:9/9/2005
Keywords:kbQuery kbcode kbReplication kbBug KB823545 kbAudDeveloper