rbellamy
rbellamy

Reputation: 5833

SQL Server: How to Determine all tables associated with replication, and which articles

How would I iterate through the tables of a database, and determine which publication and article those tables are associated with?

Upvotes: 0

Views: 3834

Answers (3)

AFF
AFF

Reputation: 117

You could use this system table: SELECT * FROM dbo.sysmergearticles

Upvotes: 1

rbellamy
rbellamy

Reputation: 5833

I did a bit of profiling, and I found this, which I then looked at to find the parameters: [sys].[sp_MShelp_replication_table] ( @table_name sysname = NULL, @table_owner sysname = NULL )

Upvotes: 2

Raj More
Raj More

Reputation: 48024

You will have a database that is normally called DISTRIBUTION that houses your tables. Note: This name can be changed at the time replication is configured.

The following tables will give you information about the replication:

  • MSPublications
  • MSArticles

You can join these tables to the Information_Schema.Tables in your database and figure out which tables are a part of what publication.

Upvotes: 1

Related Questions