Sunday, February 12, 2012

Adding articles to existing subscription(s)

If I add an article to an existing publication that already has push
subscriptions, how can I get the new article to the subscriber databases
without running a full snapshot or reinitializing the subscription etc.?
I am running SQL Server 2K sp3 on Windows 2K/2K3.
Thank you.
For transactional replication, you just need to run the snapshot agent and
then synchronize (running the snapshot agent will only create a snapshot of
the new article).
HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Paul,
Thank you for your answer. I have tried running the snapshot agent and I
get the following message:
A snapshot was not generated because no subscriptions needed initialization.
Maybe the question I should be asking is how to get the existing
subscriptions to realize that there is a new article and it should be part of
the subscription. The subscriptions report that not all articles are part of
the subscription after I add the new article.
Thanks.
"Paul Ibison" wrote:

> For transactional replication, you just need to run the snapshot agent and
> then synchronize (running the snapshot agent will only create a snapshot of
> the new article).
> HTH,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
>
|||I have found the solution, you need to run sp_refreshsubscriptions in the
publisher database and the snapshot will only move the new article that was
added not the the entire publication.
Thanks for you assistance.
"Len Gustafson" wrote:

> If I add an article to an existing publication that already has push
> subscriptions, how can I get the new article to the subscriber databases
> without running a full snapshot or reinitializing the subscription etc.?
> I am running SQL Server 2K sp3 on Windows 2K/2K3.
> Thank you.
|||Len,
this type of script should be what you need:
exec sp_addarticle @.publication = 'tTestFNames'
, @.article = 'tEmployees'
, @.source_table = 'tEmployees'
exec sp_addsubscription @.publication = 'tTestFNames'
, @.article = 'tEmployees'
, @.subscriber = 'RSCOMPUTER'
, @.destination_db = 'testrep'
Rgds,
Paul Ibison

No comments:

Post a Comment