I created a C# WinForms application which uses merge replication and MSDE to sync up laptops with a central SQL Server 2000 database. The primary keys have always been set to "Not for Replication", but after experiencing data conflicts when syncing I set all foreign keys to "Not for Replication" as well. This took care of the conflicts, but soon afterwards users started receiving the following error on inserts:

"Violation of PRIMARY KEY constraint 'PK_mytable'. Cannot insert duplicate key in object 'mytable'.

The error occurs right when the INSERT stored procedure is run on the local machine (against the MSDE), not when trying to merge. The primary key is an Identity field, so I'm at a loss to explain why this is happening, as it should automatically pick a valid id. Interestingly, the users can try the insert 2 or 3 more times and eventually have success.

Any ideas why this error is happening? I'm relatively new to merge replication, but I tried to put all the relevant facts in this post. Thanks in advance.