Sql-server – 2012 Transactional replication not delivering new articles

replicationsql serversql-server-2012transactional-replication

I have added a new article to an existing push publication with the following code

sp_addarticle @publication='statics', article='FlightBaggageMarkup_tbl',source_object='FlightBaggageMarkup_tbl'

  EXEC sp_addsubscription
  @publication = 'Statics',
  @subscriber = 'SURVIVOR',
  @destination_db = 'MLT-Replicated'

this is a push subscription with immediate_sync switched off, running continuously instead of a schedule

run the snapshot agent and see it picks up just the new table, ok great. but the table and the custom stored procedures never appear at the subscriber and then replication falls over if you try to change a value in the source table as it cant find the stored procedure to call on the subscriber ? I have only seen this behavior since upgrading to 2012, but this maybe a coincidence

Best Answer

According to Define an Article:

If the publication has existing subscriptions and sp_helppublication returns a value of 0 in the immediate_sync column, you must call sp_addsubscription to add the article to each existing subscription.

After executing sp_addarticle, execute sp_addsubscription to add the article to each existing subscription. Then generate a new snapshot. The Distribution Agent should then copy the schema and data for the newly added article to the Subscriber(s).