XML: Typed and Untyped

Occasionally we hear from people who are surprised to find that their XML data uses more space when typed than when untyped. In general, this is to be expected. Typed XML has some advantages over untyped XML, namely smarter query plans and the ability to constrain user input, but size usually isn’t one of them….


XML Data Type Limitations

I’d like to take some time today to explain some of the seemingly arbitrary limits placed on the XML data type, specifically those related to ID/IDREF validation, complex XML Schema types, the depth limit for XML data, and the enigmatic “XSD schema too complex” error. ID/IDREF ValidationIf your typed XML document has attributes of type…


Check Out Denis Ruckebusch’s Blog

I’m adding a link in the sidebar to Denis Ruckebusch’s blog. Denis is one of our testers for the XML data type, and he has two recent posts worth reading if you use XML in SQL Server 2005. The first explains how to modify a schema to work around some of the limitations in our…


Dealing with the Limitations of XSD Content Models

There was recently a question on an internal mailing list about how to model RSS 2.0 with XML Schema. The short answer is that it can’t be done. The problem lies with the content model of the <channel> element, which consists of three elements which must appear exactly once, several elements which may optionally appear…


An article on FOR XML in Microsoft SQL Server 2000 and 2005

I just posted an article What does server side FOR XML return? (http://blogs.msdn.com/sqlprogrammability/articles/576095.aspx) which gives some details of the design and performance characteristics of various FOR XML flavors.   I also added links to XML whitepapers and publications on the design of XML features in Microsoft SQL Server 2005 to the links section of the…


What does server side FOR XML return?

XML publishing functionality exposed as “FOR XML” in Microsoft SQL Server 2000 evolved quite a bit in SQL Server 2005. So, I thought I would document the matrix of what FOR XML results in. This article should help understand some performance characteristics and limitations of FOR XML as well as the difference between the following…


Name resolution, default schema, implicit schema Part II

Last section clarified some background, let us continue with Name Resolution Algorithm for Types and XML Schema Collections [Algorithm] As implied by general syntax for referencing entities, types or XML schema collections cannot be referenced across database. If schema name is unspecified, SQL server uses “sys first” algorithm as outlined below. 1.      First, Look in the “sys”…