What a real world production environment example for storing and or using a XML schema in a SQL Server database?
I am working my way though the Microsoft 70-461 exam objectives. I have
completed the Microsoft walk through for creating and storing an XML
schema in the database at
https://technet.microsoft.com/en-us/library/ms176009(v=sql.110).aspx .I have yet to work in a database environment where the application
will access a XML schema that is stored in the database. What is a
real world use case for creating and storing a XML schema in a
production SQL Server database?
Best Answer
XML Schemas aren't stored in SQL Server so that an application can access them. The reasons for storing XML Schema Collections are found in how they improve working with the XML data.
According to the MSDN page for XML Schema Collections:
And, according to the MSDN page for Compare Typed XML to Untyped XML:
So the reasons to use an XML Schema Collection are:
type="xsd:int"
and it took up more space than the untyped, but perhaps other types such asdatetime
and/orfloat
optimize better)Below are two articles / posts related to the performance benefits of typed XML. There is mention of XML Indexes performing much better with typed XML than with untyped. But, there is also mention of typed XML being worse for DML operations.