APPLY

Function and Queries to Convert Hierarchical Adjacency to Nested Json Arrays

  • Script

This script converts hierarchical adjacency into nested json rows which contain the recursive "downlines" of each node.  The table-valued function treats each row in the original adjacency as the root node in a recursive common table expression. 

2019-11-24

329 reads

Function and Queries to Convert Hierarchical Adjacency to Nested Json Arrays

  • Script

This script converts hierarchical adjacency into nested json rows which contain the recursive "downlines" of each node.  The table-valued function treats each row in the original adjacency as the root node in a recursive common table expression. 

2019-11-12 (first published: )

759 reads

Blogs

Daily Coping 26 Nov 2020

By

I started to add a daily coping tip to the SQLServerCentral newsletter and to...

Azure SQL Database – Greatest and Least TSQL

By

Being in the cloud does have many benefits, from lower administration to fast scaling...

T-SQL Tuesday Retrospective #005: Reporting

By

A few weeks ago, I began answering every single T-SQL Tuesday from the beginning....

Read the latest Blogs

Forums

Join to lookup table on multiple columns

By sunsilk10

Hi I have a table Meter and a lookup table LookupTbl I need to...

How to know which index is invalid index on a table?

By 892717952

There are about thirty fields in a table SaleOrderLines, I created some indexes ,...

Thanksgiving 2020

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Thanksgiving 2020

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers