OPENJSON

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. 

You rated this post out of 5. Change rating

2019-11-25 (first published: )

742 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. 

You rated this post out of 5. Change rating

2019-11-12 (first published: )

2,030 reads

Blogs

KDA: Echoes of Deception - Onboarding

By

I’ll walk through the KDA UI and tackle the first challenge before diving into...

Kusto Detective Agency - Intro

By

While I mostly write about SQL Server, I have a soft spot for Kusto....

The Book of Redgate: Customer Quotes

By

Many organizations list customer testimonials and quotes on their websites or literature. It makes...

Read the latest Blogs

Forums

How to take a backup as a .bak file while omitting some tables?

By Saran_

Hi Guys, I'm not sure if this is possible or not, but let me...

Life Moves Pretty Fast

By Grant Fritchey

Comments posted to this topic are about the item Life Moves Pretty Fast

Parse XML data from SQL table using temp tables and variables

By Lord Slaagh

Hello SSC, Happy Friday! I have to optimize a process that uses dynamic SQL...

Visit the forum

Question of the Day

Multiple Collations

Can I have a collation expression like this in SQL Server 2022?

...
WHERE ColumnA = ( 'abc' COLLATE French_CI_AS) COLLATE French_CS_AS
...

See possible answers