0

I have 2 server (Server1, Server2). I want to run a script to make Server2, the subscriber of Server1. It's very simple using wizard. I have generated related script using wizard but it doesn't work. The script is:

EXEC sp_addmergesubscription 
    @publication = 'MergePub', 
    @subscriber = 'Server2', 
    @subscriber_db = 'MergeDB',
    @subscription_type = N'push', 
    @sync_type = 'Automatic', 
    @subscriber_type='Global';
EXEC sp_addmergepushsubscription_agent
    @publication = 'MergePub',
    @subscriber = 'Server2', 
    @subscriber_db = 'MergeDB'
    @subscriber_login = 'sa'
    @subscriber_password = '123'

what's the wrong stuff?

Mohammad Sheykholeslam
  • 1,379
  • 5
  • 18
  • 35

1 Answers1

1

Its hard to say based on your description what is wrong as you provide no error message.

I'm able to create a Merge push subscription with the following script:

    -- Add a push subscription to a merge publication.
USE [AdventureWorks2008R2]
EXEC sp_addmergesubscription 
  @publication = @publication, 
  @subscriber = @subscriber, 
  @subscriber_db = @subscriptionDB, 
  @subscription_type = N'push';

--Add an agent job to synchronize the push subscription.
EXEC sp_addmergepushsubscription_agent 
  @publication = @publication, 
  @subscriber = @subscriber, 
  @subscriber_db = @subscriptionDB, 
  @job_login = $(Login), 
  @job_password = $(Password);
GO

Have a look at How to: Create a Push Subscription.

Brandon Williams
  • 3,695
  • 16
  • 19