Software⏱️ 4 min read📅 2026-06-15

How to Fix: SqlServer Merge Replica push - exec sys.sp_MSaddmergetriggers throws error

SQL Server merge replica push error fix

Quick Answer: Check if the 'MSmerge_ctsv' object exists and has the necessary permissions.

The error 'Cannot find the object 'MSmerge_ctsv_A6203259D69B49709C5BE266A99D0DBC', because it does not exist or you do not have permission.' occurs when attempting to merge a database in SQL Server 2017 Developer Edition. This issue affects users who are setting up a replication environment, specifically those using the MSaddmerge triggers system procedure. The error is frustrating as it prevents the successful synchronization of subscriber databases, which can lead to data inconsistencies and lost productivity.

The primary cause of this error is related to the way SQL Server handles database objects and permissions. Specifically, when creating a merge trigger, SQL Server needs to create a system view that does not exist by default. This issue can arise due to insufficient permissions or incorrect object naming conventions.

🛑 Root Causes of the Error

  • The primary root cause of this error is related to the way SQL Server handles database objects and permissions. Specifically, when creating a merge trigger, SQL Server needs to create a system view that does not exist by default. This issue can arise due to insufficient permissions or incorrect object naming conventions.
  • An alternative reason for this error could be due to the fact that the database collation is set to a case-sensitive format, causing the system view name to be created with a different casing than expected.

🛠️ Step-by-Step Verified Fixes

Resolving the issue by modifying the collation and permissions

  1. Step 1: Step 1: Check the database collation to ensure it is set to a case-insensitive format. If using a case-sensitive collation, switch to a case-insensitive one, such as 'SQL_Latin1_General_CP1_CI_AS'.
  2. Step 2: Step 2: Verify that the user account used for SQL Server authentication has sufficient permissions to create and modify database objects. Ensure that the user account is a member of the db_owner or db_admin fixed database roles.
  3. Step 3: Step 3: Run the following command to re-create the system view: `exec sys.sp_MSaddmergetriggers N'systemunits', N'dbo', null, 0';` and then retry the merge operation.

Alternative fix method using database snapshot

  1. Step 1: Step 1: Create a database snapshot of the source database. This will provide a consistent starting point for the merge operation.
  2. Step 2: Step 2: Drop any existing merge triggers and re-create them using the `exec sys.sp_MSaddmergetriggers` system procedure. Ensure that the user account used for SQL Server authentication has sufficient permissions to create and modify database objects.

🎯 Final Words

To resolve the 'Cannot find the object' error when merging a database in SQL Server 2017 Developer Edition, check the database collation and permissions, or use an alternative fix method involving database snapshots. By following these steps, users can successfully set up their replication environment and ensure data consistency across subscriber databases.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions