Handling Graphs, Trees, and Hierarchies in Microsoft SQL Server
Play Handling Graphs, Trees, and Hierarchies in Microsoft SQL Server
Graphs are specialized data structures that represent relationships between pairs of items. Examples for graphs include an Employee Organizational Chart and a Bill of Materials. This session explains how to query graph data stored in SQL Server to answer common requests, including: Subgraph, e.g., return all subordinates of a given manager. Path, e.g., return all management chain of a given employee. Presentation, e.g., sort employees such that a subordinate would be returned after a manager. This session explains how to handle such requests with recursive queries in SQL Server 2005 and also with the new HIERARCHYID datatype introduced in SQL Server 2008.