GUID of 00000000-0000-0000-0000-000000000000 causing merge index violation

RThomas picture RThomas · Aug 9, 2011 · Viewed 23.9k times · Source

Our developer has a linq-2-sql project that talks to my database. The database is involved in merge replication. It has been in use for some time and was working fine. A recent table was added to the schema and now is causing problems when new records are added.

The user get's an error message stating that the index related to the guid that merge replication automatically creates is violating a unique constraint.

From what I can tell the table isn't any different than others that are involved. I have recreated the entire replication publication/subscription model from scratch and everything continues to work but that one table.

Anyone have any ideas? The guid being created appears as 00000000-0000-0000-0000-000000000000 which would explain why it's a duplicate. Why is a valid guid not being created by linq?

Answer

MarkPflug picture MarkPflug · Aug 9, 2011

Did you use "new Guid()" somewhere in your code base when what you meant was "Guid.NewGuid()"?