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 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.