SqlHierarchyId.GetAncestor(Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Retrieves the SqlHierarchyId node n
levels up the hierarchical tree.
[Microsoft.SqlServer.Server.SqlMethod(DataAccess=Microsoft.SqlServer.Server.DataAccessKind.None, InvokeIfReceiverIsNull=false, IsDeterministic=true, IsMutator=false, IsPrecise=true, OnNullCall=false, SystemDataAccess=Microsoft.SqlServer.Server.SystemDataAccessKind.None)]
public Microsoft.SqlServer.Types.SqlHierarchyId GetAncestor (int n);
[<Microsoft.SqlServer.Server.SqlMethod(DataAccess=Microsoft.SqlServer.Server.DataAccessKind.None, InvokeIfReceiverIsNull=false, IsDeterministic=true, IsMutator=false, IsPrecise=true, OnNullCall=false, SystemDataAccess=Microsoft.SqlServer.Server.SystemDataAccessKind.None)>]
member this.GetAncestor : int -> Microsoft.SqlServer.Types.SqlHierarchyId
Public Function GetAncestor (n As Integer) As SqlHierarchyId
Parameters
- n
- Int32
An integer representing the number of levels to ascend in the hierarchy.
Returns
SqlHierarchyId representing the n
th ancestor of this.If a number greater than GetLevel() is passed, null is returned.If a negative number is passed, an exception is raised indicating that the argument is out of range.
- Attributes