Summary

We can now work with hierarchical data that lives in normal relational tables. In this chapter, you learned how to use the new hierarchyid data type in SQL Server 2008 to cast a tree structure over data stored in everyday database tables, rows, and columns. The hierarchyid data type provides a set of methods and indexing strategies to enable efficient searching and manipulation of hierarchy nodes at the database level. This enables us to apply a hierarchical model to traditional table data rather than resorting to XML, in scenarios where it makes better sense to keep the data stored relationally than to refactor (revise) the data for XML storage.

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.