Character Data as XML
XML, in all its dialects, is stored ultimately as string (character) data. Before the xml data type, XML data could only be stored in SQL Server using ordinary string data types, such as varchar(max) and text, and doing so raises several challenges. The first issue is validating the XML that is persisted (and by this we mean validating the XML against an XSD schema). SQL Server has no means of performing such a validation using ordinary strings, so the XML data can’t be validated except by an outside application which can be a risky proposition (the true power of a relational database management system, or RDBMS, is applying rules at the server level).
The second issue is querying the data. Sure, you could look for data using ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access