Tag Archives: sys.sysobjects

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:

 SELECT * FROM
 (
 SELECT
 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
 FROM
 sys.sysobjects
 WHERE
 replinfo=1
 ) AS T
 WHERE
 ObjectType IS NOT NULL
 GO

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

http://Extreme-Advice.com

http://www.sqlhub.com

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