Chapter 7. Hierarchical Data and the Relational Database

Leonard Lobel

Hierarchical data is not relational. It is organized as a tree structure of parent and child elements rather than as flat lists of rows in related tables. The most common hierarchical data format in today’s world is XML, and in Chapter 6, we covered the rich XML support that Microsoft SQL Server provides. There’s no doubt that XML is the right database storage choice for hierarchical data in many scenarios. It can be particularly useful when that data is consumed in XML format by client applications or in circumstances where you need to store and retrieve the entire hierarchy at a single time.

But XML is the wrong choice when you’d prefer to keep your data stored relationally ...

Get Programming Microsoft® SQL Server™ 2008 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.