In replication, if we add a column in Publisher then it doesnt replicate to Subscriber unless it is done explicitly. I am looking for a way to track or monitor this. I am not able to find any system stored procedure which I can use to compare the columns and if they are replicated between Publisher and Subscriber.
Asked
Active
Viewed 269 times
1
-
1Hi and welcome to the community. Maybe the answer in that question will help. Replication Monitor Information using T-SQL – McNets Jul 09 '21 at 12:38
-
Is DDL replication enabled in the publication? – rois Jul 10 '21 at 08:58
1 Answers
0
I don't have access right now to a replicated instance to verify but I believe the system tables and DMVs should help.
sys.dm_repl_schemas "Returns information about table columns published by replication." Those will be the ones currently in the published article.
sys.columns will list all the columns in the source table. (You can join to sys.objects or use OBJECT_NAME() to get the table; similarly for the schema.)
By comparing those two lists you'll know which columns have been added to the base table without being included in the replication article.
Michael Green
- 24,839
- 13
- 51
- 96