Microsoft KB Archive/823545

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

Article ID: 823545

Article Last Modified on 9/9/2005

-

APPLIES TO


 * Microsoft SQL Server 2000 Standard Edition
 * Microsoft SQL Server 2000 Windows CE Edition 2.0

-



Bug #: 469724 (SQL Server 8.0)



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:  Create the publisher database without defining referential integrities on the articles. 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. Update the database. 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:  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. 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.</li> Edit the Run Agent step.</li> Click the Advanced tab, and then click Go to next step in the OnSuccess action list.</li></ol> </li></ol>

<div class="references_section">