Converting XML data into relational columns and rows is not an easy process. The OPEXML function was introduced to shred XML data in SQL Server 2000, and then XML shredding was improved by the XPath language (also known as XQuery) in SQL Server 2005. Since then, the process of querying XML data became a solid solution to deliver results. This chapter will demonstrate how to query XML data as a single unit and return the retrieved data across a table’s column.
4-1. Shredding XML with Internal ENTITY Declarations
Problem
You want to return a rowset result out of the XML data ...