all groups > sql server replication > september 2005 >
You're in the

sql server replication

group:

Automate inclusion of new tables?


Automate inclusion of new tables? Bill_B
9/20/2005 4:05:02 PM
sql server replication:
I'm running snapshot replication, and there will often be new tables (and
other objects) added to the publisher that I'd like to automatically include
in the subscription. Any ideas on how to do this? I've thought about creating
a script that lists all the tables, etc., in a publisher, and then including
each of those in the subscription, but I have no idea if/how it would work.
Re: Automate inclusion of new tables? Paul Ibison
9/21/2005 9:21:37 AM
You could use sp_addarticle and sp_addsubscription for each new table.
Finding the new tables depends on how you have this set up. If it is all the
tables, you could find tables from information_schema.tables which are not
in sysarticles, and use a cursor to iterate through and run the stored procs
ablve.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

AddThis Social Bookmark Button