views:

62

answers:

2

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

+1  A: 

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.

Raj More
Okay... that's coming at it from the other side, which will totally work. I was hoping that maybe there was a SQL Server proc that, given a table name, would indicate the publication and article it was associated with.
rbellamy
A: 

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 )

rbellamy