Merge Replication error: You do not have permission to run 'SP_TRACE_GENERATEEVENT' Merge Replication error: You do not have permission to run 'SP_TRACE_GENERATEEVENT' sql sql

Merge Replication error: You do not have permission to run 'SP_TRACE_GENERATEEVENT'


As per Microsoft documentation:

COM object initialization failed for an XML Subscriber. Some reasons why merge replication did not apply schema changes to the Subscriber include the following:

  • A failure to create a directory to write the temporary snapshot files.

  • A failure to enumerate schema articles.

  • For SQL Server Compact Subscribers, a failure to reinitialize the subscription.

  • If the object is message based, a failure to write to the message file.

Have you allocated enough memory to SQL Server and is anything filling up, such as transaction logs or disks?

Source: https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2012/dd581610(v=sql.110)


sp_trace_generateevent Creates a user-defined event in SQL Server. See sp_trace_generateevent

User must have ALTER TRACE permission.

Grant the SQL Replication Service account the Alter Trace permission on the Publisher.

Step 1 : Login to the SQL server (Publisher) with sys admin rights.

Step 2 : Navigate to server properties and then to permissions tab.

Step 3 : Select the account that is being used to run replication on the Subscribing SQL Server. In this example it is the account "ADMS-SINC91LTZ1" , then click the "Alter Trace" Grant permission to it.

Step 4: Stop and Start the SQL Merge Agent on the Subscriber