FOR JSON

Technical Article

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

436 reads

Technical Article

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: )

1,257 reads

Blogs

A New Form of Address: Mx

By

When I was presenting at the dataMinds Connect conference, I called on someone in...

Group By Starting Characters

By

I was chatting with Jeff (b|t) on my team yesterday and the context escapes...

Daily Coping 22 Oct 2021

By

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

Read the latest Blogs

Forums

Finding all logins that can alter DDL

By webrunner

Hello experts, Is there a ready-made query out there that I could run on...

Insert records with a where

By saintor1

I want to insert record job allocations only for selected jobs I know the...

Insert records with a where

By saintor1

I want to insert record job allocations only for selected jobs I know the...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers