Groups | Blog | Home
all groups > sql server replication > november 2004 >

sql server replication : How to know if article/publication exists?


Paul Ibison
11/19/2004 8:48:13 AM
Have a look in the code for sp_helppublication and
sp_helparticle. This code can be adapted for your
purposes. I'm not at a box with SQL right now, but if you
have problems with this, post back and I'll create a
script for you later.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
José Araujo
11/19/2004 5:37:40 PM
Hi,

I am creating an automated way to add new tables to my publication.

I have a script that creates the publication(s) and add the tables articles
to the appropriate publication(s).

What happens is that i want to be able to use the same SP to add new tables,
so my ideal script would be able to know if the publication exists, and it
would be able to know if a given article exists.

It can be done using stored procedures but stored procedures can not be
queried (unless I insert into a table, but then i would have to create the
table and that's a pain). So, I am looking for an alternative.

Any ideas? Thanks, José.

AddThis Social Bookmark Button