October 2008
Beginner to intermediate
1024 pages
31h 30m
English
Reorganizing a hierarchy is a common maintenance task. You might often need to alter the tree structure by changing the parent-child relationships within the hierarchy. The hierarchyid type provides a GetReparentedValue method that makes it easy to handle this kind of maintenance. We will start by first relocating just a single node without disturbing any other nodes in the hierarchy. Then we’ll relocate an entire subtree (that is, all of a node’s descendant nodes).
You invoke the GetReparentedValue method on the node you want to move, passing in two parameters. The first specifies the original parent (the source), and the second specifies the new parent (the target). Returning ...
Read now
Unlock full access