Dynamic Filters, Merge Repl and Named Instances

  • We are in the process of consolidating our field servers into a single server, multi SQL Instance environment.  We currently have merge replication running using dynamic filtering based upon the hostname of the subscriber.  This, however, will not work in the new environment (hostname() returns the same value for all instances on that server).

    Does anyone know of a way to use dynamic filtering with named instances on the same server?

  • Hi,

    the replication merge agent has a parameter - HOSTNAME - which can be added to the job and configured accordingly.

    HTH,

    Paul

    ps a few more details on http://www.replicationanswers.com (merge section)


    Paul Ibison
    Paul.Ibison@replicationanswers.com

  • Thanks,  that worked like a charm. 

     

    Greg

  • Where is that HOSTNAME parameter set though?

    TIA

  • Using the @optional_parameters in sp_addmergepullsubscription_agent does not work.

    Instead, the change must be made in sp_add_jobstep.

    execute @ReturnCode = msdb.dbo.sp_add_jobstep @job_id = @JobID , @step_id = 1

     , @cmdexec_success_code = 0, @on_success_action = 1, @on_success_step_id = 0

     , @on_fail_action = 2, @on_fail_step_id = 0, @retry_attempts = 10, @retry_interval = 1

     , @os_run_priority = 0, @flags = 0, @step_name = N'Run agent.', @subsystem = N'Merge'

     , @command = N'-Hostname ID_1 -Publisher [PubServer] -PublisherDB [pubdb] -Publication [PubName] -Subscriber [ClientMachine] -SubscriberDB [ClientDB] -SubscriptionType 2 -SubscriberSecurityMode 1  -Distributor [PubServer]  -Continuous'

     , @server = N'ClientMachine', @database_name = N'ClientDB'

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply