Sql-server – Merge replication issue : conflicts with new data

merge-replicationreplicationsql serversql-server-2008

I set up merge replication with SQL Server 2008, I am having issues when creating new data on clients and trying to synchronize with the remote server.

Pulling data from the server works fine. But when adding new data from the clients and synchronizing, I get conflicts for the publication updates with error in conflict manager:

Upload inserts failed.

This failure can be caused by a constraint violation. Invalid object name 'dbo.MSmerge_repl_view_CCEBB5FB95354A40940D433C94AAAF3E_FF89BB83CC734065B74175EFC3B6E922'.

I found that dbo.MSmerge_repl_view_... is a system view but I am guessing it is from the client since I cannot find it on the server.

I don't get why this is happening. Is the data being uploaded to the view (which doesn't exist on the server) ? if someone can explain why this might happen it would be great !

Best Answer

That view is created by replication and used internally. If it is missing, either it got deleted accidentally, or sql servers replication metadata got corrupted.

Depending on how big you databases are and if you can afford some downtime, the easiest way to fix this is to drop and recreate the merge replication setup.