Problem: I need to extrapolate the parentID from the hierarchyID.
Example: My columnID is 8 and my current hierarchyID is /1/2/4/8
. When I call columnName.GetAncestor(1)
, this will give me /1/2/4/
. What I need is the ID of 4
.
How do I do this? Or are hierarchyIDs only meant to be joined on?
I'm looking into the SqlHierarchyID.Parse() but I'm not understanding how to use it.