Questions tagged [hierarchyid]

hierarchyid is a TSQL extension available from SQL Server 2008 to map hierarchical structures in a flat table. It supports in-order-sorting, get-descendant and level-queries

hierarchyid is a TSQL extension available from SQL Server 2008 to map hierarchical structures in a flat table. It supports in-order-sorting, get-descendant and level-queries

152 questions
-1
votes
1 answer

Flatten parent child hierarchy with multiple parents

I have a parent-child hierarchy in my source structure where a child could point to his parent and for his parent could exist multiple rows. If we than flatten the hierarchy this would mean that every child row need to exist beneath his parent…
OverflowStack
  • 259
  • 1
  • 3
  • 17
-1
votes
1 answer

Getting all the ancestors doesn't work

I am using HierarchyId in SQL server and I am referring the the article below to to get all the ancestors https://technet.microsoft.com/en-us/library/bb677212%28v=sql.105%29.aspx I have following code: DECLARE @last_child HIERARCHYID select…
Lost
  • 12,007
  • 32
  • 121
  • 193
1 2 3
10
11