I'm trying to establish a merge replication between SQL Server 2012 (SP2) servers. In the New Subscription Wizard, I want to setup the Agent Schedule and I have the following error when selecting "Define schedule..."
Of course I have Googled the error but can't find anything helpfull.
thanks for your time and help
I suggest you leave the subscription as Run on demand only
during creation, then invoke it manually via Replication Monitor to see if it synchronizes your data successfully and then add the synchronization schedule manually via a call to sp_addmergepushsubscription_agent
like below:
exec sp_addmergepushsubscription_agent @publication = N'Publication_Name', @subscriber = N'Subscriber_Server_Name', @subscriber_db = N'Subscriber_DB', @job_login = null, @job_password = null, @subscriber_security_mode = 1, @publisher_security_mode = 1, @frequency_type = 4, @frequency_interval = 1, @frequency_relative_interval = 1, @frequency_recurrence_factor = 0, @frequency_subday = 8, @frequency_subday_interval = 1, @active_start_time_of_day = 100, @active_end_time_of_day = 235959, @active_start_date = 0, @active_end_date = 0
The above call will add run-once-per-hour-every-day
schedule to a merge publication called Publication_Name
in the subscriber server name Subscriber_Server_Name
and Subscriber DB = Subscriber_DB
.
I have obtained this call example by running Generate Scripts
over my existing Merge Publication with Subscription schedule defined.
Read more about sp_addmergepushsubscription_agent
parameters and their possible values here: https://learn.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-addmergepushsubscription-agent-transact-sql
Note, this is not uncommon for some Replication related action to fail in SSMS UI but to succeed via manual stored procedure execution. You just need to generate the correct sp_*
call.
Hope this helps to resolve your issue.