T-SQL Query for Replication Articles

Randy Minder picture Randy Minder · Jan 3, 2011 · Viewed 34.4k times · Source

Does anyone know of a query I could run that would tell me what articles, if any, in a target database, are associated with a transactional replication publication?

Answer

davmos picture davmos · Apr 13, 2015

For those needing a quick snippet...

SELECT 
  msp.publication AS PublicationName,
  msa.publisher_db AS DatabaseName,
  msa.article AS ArticleName,
  msa.source_owner AS SchemaName,
  msa.source_object AS TableName
FROM distribution.dbo.MSarticles msa
JOIN distribution.dbo.MSpublications msp ON msa.publication_id = msp.publication_id
ORDER BY 
  msp.publication, 
  msa.article