hierarchyid有关的一些函数

于hierarchyid有关的一些函数主要有:
    GetAncestor :取得某一个级别的祖先
    GetDescendant :取得某一个级别的子代
    GetLevel :取得级别
    GetRoot :取得根
    IsDescendantOf :判断某个节点是否为某个节点的子代
    Parse :将字符串转换为hierarchyid。该字符串的格式通常都是/1/这样的
    Read :Read 从传入的BinaryReader 读取SqlHierarchyId 的二进制表示形式,并将SqlHierarchyId 对象设置为该值。不能使用Transact-SQL 调用Read。请改为使用CAST 或CONVERT。
    GetReparentedValue :可以用来移动节点(或者子树)
    ToString :将hierarchyid转换为字符串,与parse正好相反
    Write : 将SqlHierarchyId 的二进制表示形式写出到传入的BinaryWriter 中。无法通过使用Transact-SQL 来调用Write。请改为使用CAST 或CONVERT。

值间关联:NodeID.GetAncestor(1) = NodeID

原文地址:https://www.cnblogs.com/hbwy/p/8351076.html