Merge replication subscription sql agent job not being created

Y a h y a 416 Reputation points


I am creating a pull subscription by running below code at the end. The subscription gets created but not the sql agent job. What am I missing?



DECLARE @publication AS sysname;
DECLARE @publisher AS sysname;
DECLARE @publicationDB AS sysname;
DECLARE @hostname AS sysname;
SET @publication = N'MYPUB';
SET @publisher = N'MYPUBSERVER';
SET @publicationDB = N'MYPUBDB';

EXEC sp_addmergepullsubscription 
  @publisher = @publisher, 
  @publication = @publication, 
  @publisher_db = @publicationDB;

EXEC sp_addmergepullsubscription_agent 
  @name ='WebSync Agent',  
  @publisher = @publisher, 
  @publisher_db = @publicationDB, 
  @publication = @publication, 
  @distributor = @publisher, 
  @internet_login = 'My Login', 
  @internet_password = 'My PasswordXyzpassabc099',
  @use_web_sync =1, 
  @internet_url = '', 
  @internet_security_mode = 0
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
11,589 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Cris Zhan-MSFT 6,596 Reputation points

    Try to specify the @hostname parameter in sp_addmergepullsubscription_agent .

    Please refer to the official document: Create a Pull Subscription, and pay attention to the required steps and examples.
    The last step is to execute the sp_addmergesubscription at the publisher.

    0 comments No comments

  2. Y a h y a 416 Reputation points

    Hi Criszhan-m

    The subscription as well as the web synchronisation at publisher's end is setup and the web synchronisation url checks out. Its sql agent at the remote sql server subscriber that does not want to create a job in response to sp_addmergepullsubscription_agent. So basically failing at step 3 in the article that you kindly provided.