Finding Replication Publications For A Table

If you want to drop or rename a table, you will need to make ensure the table is not an article of a publication. If it is article for any publication, you need to find out what are those publications. If you have several publications and if one table is an article for many publications, it is not an easy task to check publications one by one.

The below query can be executed against the publisher database by providing the table name in the where clause. This query outputs the Publication Name, Source Table Name and the Destination Table.

SELECT P.name Publication,
A.name TableName,
A.dest_table DestinationTable FROM
syspublications P INNER JOIN
sysarticles A ON P.pubid = A.pubid
WHERE p.name ='TableName'
]]>

Leave a Reply

Your email address will not be published. Required fields are marked *