September 2010
Intermediate to advanced
1704 pages
111h 8m
English
The script in Listing 42.15 performs the initial population of the Parts_hierarchy table. What if you need to add additional records into the table? Let’s look at how to use the GetDescendant method to add new records at different levels of the hierarchy.
For example, to add a child part to the Body node (node /2/), you can use the GetDescendant method without any arguments to add the new row below Body node at node /2/1/:

To add a new row as a higher descendant node at the same level as the left front fender inserted in the previous example, you use the GetDescendant method again, but this time passing the Hierarchyid ...