Skip to main content

Script to get articles detail - SQL Server Replication

Before a some months, I shared a one script which is relevant to replication as below, Please have a read here. Sometime we need to have information of articles for reports or to check the article exist or not, in which publication it have and for which subscribers. So this kind of details we can achieve with below script which is run against in publication database,
USE PublisherDB

SELECT sub.srvname, -- Subscriber Server name 
       sub.dest_db, -- Subscriber Database Name, -- Publication name, -- Article name
       art.dest_table, -- Published Object name
       art.dest_owner -- Published Schema name
FROM   sysextendedarticlesview art 
       INNER JOIN syspublications pub 
               ON ( art.pubid = pub.pubid ) 
       INNER JOIN syssubscriptions sub 
               ON ( sub.artid = art.artid ) 

Hope this script may be very useful to you and you enjoyed a lot. Have a great day and stay tuned for more!