Move a node and sub-nodes in a hierarchyid RRS feed

  • Question

  • I have a hierarchyid that's roughly like this:


    I want to move /1/... so that it and all its children are below /2, so that the new hierarchy table looks like this


    I've followed this example but it only moves the children of /1 and not /1 itself. I'd like to move /1 itself and all its children. I can't just specify / as the old parent, because that would include /2 and I'm sure it would chuck a huge wobbly anyway!

    So, how can I move a node and it's children, and not just the children?


    Tuesday, February 18, 2014 5:13 AM