How would I iterate through the tables of a database, and determine which publication and article those tables are associated with?
views:
62answers:
2
+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
2010-01-05 20:46:47
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
2010-01-05 20:51:27
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
2010-01-05 21:10:27