Merge replication subscription sql agent job not being created

Y a h y a 416 Reputation points
2021-02-17T06:19:31.923+00:00

Hi

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?

Thanks

Regards

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';

USE [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 = 'https://mydomain.com/SQLReplication/replisapi.dll', 
  @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.
14,136 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Cris Zhan-MSFT 6,641 Reputation points
    2021-02-17T07:51:04.44+00:00

    Hi,
    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
    2021-02-17T18:03:21.66+00:00

    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.

    Thanks

    Regards


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.