Find Object participated in replication

Find Object participated in replication

It happens many times that we want to know the object participated in replication from publisher database. We may not have populated all database objects in replication so we might want to compare the object.

Sometime we may have populated all tables, view etc. in replication but over the time we add some more tables or other database objects in primary (Publisher) database and we want to find out what are those objects.

Sometime we want to remove some of the objects from subscriber database as we might have removed it either from replication or from publisher database and wanted to remove it from subscriber database.

Reason may be more then I have discussed above but in any case, whenever, we want to get list of objects participated in replication; we can use script given below:

[sourcecode language=”sql”]
Name as ObjectName
,CASE WHEN xtype=’P’ THEN ‘Stored Procedure’
WHEN xtype=’V’ THEN ‘View’
WHEN xtype=’FN’ THEN ‘Function’
WHEN xtype=’U’ THEN ‘User Table’
END AS ObjectType
) AS T
ObjectType IS NOT NULL

Here is the list of some more articles I have written for replication, have a look if title of the article attracts you.

  • Understanding Replication with implementation of Snapshot replication in SQL Server 2012 (Click Here)
  • Remove Replication from SQL Server 2012 (Click Here)
  • Error Fix – Cannot execute as the database principal(Click Here)
  • Setup Transaction Replication in SQL Server 2012 (Click Here)
  • Add new article in transactional replication in SQL Server 2012 (Click Here)
  • Delete article from transactional replication in SQL Server 2012 (Click Here)
  • Find highest latency in transactional replication in SQL Server 2012 (Click Here)
  • Be familiar with important terms of replication in SQL Server (Click Here)

If you like this article, do like “Extreme-Advice” page in Facebook.

Reference: Ritesh Shah

Note: Microsoft Books online is a default reference of all articles.

Author: Riteshshah

Ritesh Shah is a database professional with having 16+ years of experience in various domain of IT field. He is a author of many technical articles on Microsoft Technology and authored a book of SQL Server 2012 Performance Tuning cookbook. He loves work with different Microsoft Products.