SQL Server – Replication Not Updating XML Schema Collection

replicationsql server

So the problem I'm facing is that replication from our Main instance to our Data Warehouse instance is failing because it isn't picking up XML schema updates. Thus, when it tries to bulk copy the data from the Main table that utilizes it, it fails because XML validation fails due to the XMLSchemaCollection not containing any of the updates.

The behavior that we've observed in the last couple months is that if the XML schema is new, then replication picks it up. However, from that point forward, it ignores it. This smells like a deficiency in the way it detects updates. But I'm hoping that someone else has figure this out.

Best Answer

According to Publish Data and Database Objects in the section Considerations for Publishing - Limitations on Publishing Objects:

XML schema collections can be replicated but changes are not replicated after the initial snapshot.

I agree, this appears to be a deficiency.

As a workaround, you could perform the XML schema update on the Publisher and then post the XML schema update to Subscribers using sp_addscriptexec.