Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server : subscription : how to know if a table is under replication/subscription

In SQL Server, on the "Subscription side", how can you know if a table is under replication/subscription?

Any idea?

like image 658
Posto Avatar asked Jan 20 '11 06:01

Posto


People also ask

How do you check if the table is being replicated?

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

How do you check for replication in database?

In the Configuration Manager console, go to the Monitoring workspace. Select the Database Replication node, and then select the replication link that you want to monitor.


1 Answers

I'm not sure there's a simple answer to this, and I think the answers may vary based on the type of replication. I think you may have to rely on heuristics to answer it.

For snapshot replication, I'm unable to think of anything that would give the game away. Obviously, the presence of the replication tables (e.g. MSreplication_objects) tells you that replication is occurring within the database, but there aren't any specific clues about tables, so far as I'm aware.

For transactional replication (non updating), you may be able to go via MSreplication_objects (which will list some stored procs) and then use sys.sql_dependencies to locate the tables that these relate to

For transaction replication (updating), you can look in MSsubscription_articles (or look for the presence of the subscription updating triggers against the table)

For merge replication, you can look in sysmergearticles, but you'd also have to look in sysmergesubscriptions to determine that you're on the subscription side.

like image 166
Damien_The_Unbeliever Avatar answered Sep 21 '22 18:09

Damien_The_Unbeliever