Sql-server – “an agent job has not been created for this subscription”

merge-replicationsql serversql-server-2008-r2sql-server-express

I have set up merge replication with a publisher on my SQL Server 2008 R2 box with the distributor on this box too; in Express I have created a subscriber but the subscriber won't run because of the error:

an agent job has not been created for this subscription

How can I solve this?

Best Answer

I don't know how to get past the error (I'm not sure how you're trying to "run" the subscriber), but you obviously can't use Agent to distribute changes back to the publisher, because SQL Server Express does not include Agent.

This thread seems to imply you can schedule the task outside of SQL Server using replmerg.exe from the command line:

replmerg.exe 
  -Publisher    [PUBLISHER_INSTANCE_NAME] 
  -PublisherDB  [DATABASE_NAME] 
  -Publication  [PUBLICATION_NAME] 
  -Subscriber   [SERVER\SQLExpress] 
  -SubscriberDB [DATABASE_NAME]
  -Distributor  [PUBLISHER_INSTANCE_NAME] 
  -DistributorSecurityMode 1

You might also find this Stack Overflow question useful - one of the answers there shows how to do a similar thing with C# (and I didn't read any further but there might be other useful info too). This blog post might also be helpful, showing how to accomplish this with the same type of batch script, or using Windows Sync Manager, Sync Center or Replication Management Objects (RMO).