Is there an low-cost way of querying a table with a nested set model in order to get a collection of nodes from a specific level?
i.e. How can I get IEnumerable from my tree level n? i.e. How can I get IEnumerable from my tree level n-1?
Thanks!
Is there an low-cost way of querying a table with a nested set model in order to get a collection of nodes from a specific level?
i.e. How can I get IEnumerable from my tree level n? i.e. How can I get IEnumerable from my tree level n-1?
Thanks!
Copyright © 2021 Jogjafile Inc.
Perhaps a little more than you need, but it can be trimmed down.
The following TVF will parse virtually any XML structure and return a normalized hierarchy structure.
Being a TVF, you can apply any desired
WHERE
, for exampleWHERE Lvl=3
, or even use it in aCROSS APPLY
Example
Returns
TVF if Interested