I am trying to create a merge replication as follows:
- The publisher on SQL Server 2014 sp1
- some tables are filtered using for example: @subset_filterclause = N'Siteid like "11%" and Orgid="PMV"'
- some tables are partially replicated. i.e. not all columns in the table are replicated, and that is because the total number of columns in those tables are more than 246 columns, so we excluded the not needed columns.
- on the subscriber side, there is an identical database of the publisher database but empty with no records, and I'm using this template database to be the subscriber.
When I try to run the snapshot agent, and after completing 49%, I'm getting the following error:
Error messages: Message: Invalid column name '11%'. Invalid column name 'PMV'. Failed to create merge replication triggers for object '[dbo].[a_c_budget]'. Command Text: sp_MSaddmergetriggers Parameters: @source_table = [dbo].[a_c_budget] @recreate_repl_views = 0 Stack: at Microsoft.SqlServer.Replication.AgentCore.ReMapSqlException(SqlException e, SqlCommand command) at Microsoft.SqlServer.Replication.AgentCore.AgentExecuteNonQuery(SqlCommand command, Int32 queryTimeout) at Microsoft.SqlServer.Replication.AgentCore.ExecuteDiscardResults(CommandSetupDelegate commandSetupDelegate, Int32 queryTimeout) at Microsoft.SqlServer.Replication.Snapshot.MergeSnapshotProvider.CreateArticleTriggers() at Microsoft.SqlServer.Replication.Snapshot.MergeSnapshotProvider.CreateArticleProceduresAndTriggers() at Microsoft.SqlServer.Replication.Snapshot.MergeSnapshotProvider.DoRegularMergeSnapshotPreparations() at Microsoft.SqlServer.Replication.Snapshot.MergeSnapshotProvider.DoPreArticleFilesGenerationProcessing() at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.GenerateSnapshot() at Microsoft.SqlServer.Replication.SnapshotGenerationAgent.InternalRun() at Microsoft.SqlServer.Replication.AgentCore.Run() (Source: MSSQLServer, Error number: 207) Get help: http://help/207 Server publisherServer\SQL2014, Level 0, State 1, Procedure sp_MSaddmergetriggers, Line 562 Failed to create merge replication triggers for object '[dbo].[a_c_budget]'. (Source: MSSQLServer, Error number: 20715) Get help: http://help/20715 Server publisherServer\SQL2014, Level 0, State 1, Procedure sp_MSaddmergetriggers, Line 562 Failed to create merge replication triggers for object '[dbo].[a_c_budget]'. (Source: MSSQLServer, Error number: 20715) Get help: http://help/20715 Server publisherServer\SQL2014, Level 0, State 1, Procedure sp_MSaddmergetriggers, Line 562 Failed to create merge replication triggers for object '[dbo].[a_c_budget]'. (Source: MSSQLServer, Error number: 20715) Get help: http://help/20715
The '11%' and 'PMV' are the values that I use to filter not the columns!
And the following is how the article is added:
exec sp_addmergearticle @publication = N'MaxLoadBalance_Repl', @article = N'A_C_BUDGET', @source_owner = N'dbo', @source_object = N'a_c_budget', @type = N'table', @description = N'', @creation_script = N'', @pre_creation_cmd = N'drop', @schema_option = 0x000000010C034FD1, @identityrangemanagementoption = N'none', @destination_owner = N'dbo', @force_reinit_subscription = 1, @column_tracking = N'false', @subset_filterclause = N'Siteid like "11%" and Orgid="PMV"', @vertical_partition = N'false', @verify_resolver_signature = 1, @allow_interactive_resolver = N'false', @fast_multicol_updateproc = N'true', @check_permissions = 0, @subscriber_upload_options = 0, @delete_tracking = N'true', @compensate_for_errors = N'false', @stream_blob_columns = N'true', @partition_options = 3
What to do?