Recursion

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

752 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,037 reads

Blogs

The Third Sabbatical

By

I can’t believe I’ve been at Redgate long enough to get a third sabbatical....

Advice I Like: Focus on what’s important

By

Don’t let someone else’s urgency becomes your emergency. In fact, don’t be governed by...

Is Air Travel Still Safe? | Ahmedabad Plane Crash 2025 Explained | Aviation Safety & AI Solutions

By

Is Air Travel Safe? Yes, air travel remains statistically the safest mode of transportation. In...

Read the latest Blogs

Forums

200 hours YTT in Rishikesh

By prathamyoga7

Embarking on a 200 hours YTT in Rishikesh is a transformative journey that goes...

Azure Database Watcher Monitoring

By bokswager

Hi, I’ve provisioned an Azure Database Watcher to monitor our 4 Azure SQL Managed...

Can You Ask for a Raise?

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Can You Ask for a...

Visit the forum

Question of the Day

Generating a Series I

What is returned by this code in SQL Server 2022?

SELECT value
FROM GENERATE_SERIES(4, 1);

See possible answers