Enforcing XML Schemas, a SQLCLR Example
A poster referring themselves as "OptionScalper" left an interesting question in my Don't trivialize SQLCLR post. "Mr. Tegels, You wrote: ". . . easier to develop and sustain User Defined Functions . . ." Could you provide a few concrete examples?"
Just so happens that I have fairly interesting one. As you likely know, Microsoft has provided us with method using XML Schema (XSD) to validate XML instances through binding that instance to an XML Schema collection. This is a reliable way to prevent invalid from XML from getting loading into a column and for preventing XML DML operations that would lead to invalid instances. The problem is that a number of useful constraints that can be realized with XSD are not supported. Some examples include:
Continues here