Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List all tables that are currently published for replication MS-SQL

People also ask

How do you know if a table is replication or not?

select * from sys. tables where is_replicated = 1, which will give you a list of all tables that are replicated.

How can check query for replication status in SQL Server?

Connect to the Publisher in Management Studio, and then expand the server node. Expand the Replication folder, and then expand the Local Publications folder. Expand the publication for the subscription you want to monitor. Right-click the subscription, and then click View Synchronization Status.

Which are all the replication available in SQL Server?

There are four MS SQL Server replication types: snapshot replication, transactional replication, peer-to-peer replication and merge replication.


Yes:

SELECT *
FROM sys.tables
WHERE is_replicated = 1

From MSDN for is_replicated field:

1 = Table is published using snapshot replication or transactional replication.


It's possible to query the distribution database to see what articles (tables/views/objects...) are published and which Publication they are from.

SELECT
     P.[publication]   AS [Publication Name]
    ,A.[publisher_db]  AS [Database Name]
    ,A.[article]       AS [Article Name]
    ,A.[source_owner]  AS [Schema]
    ,A.[source_object] AS [Object]
FROM
    [distribution].[dbo].[MSarticles] AS A
    INNER JOIN [distribution].[dbo].[MSpublications] AS P
        ON (A.[publication_id] = P.[publication_id])
ORDER BY
    P.[publication], A.[article];