Recursive CTE

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-25 (first published: )

478 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,433 reads

Blogs

Scary Scalar Functions - Part Two: Performance

By

Scary Scalar Functions series overview Part One: Parallelism Part Two: Performance Foreword In the second part of this...

Goal Progress for June 2022

By

I set goals at the beginning of the year, and I’m tracking my progress...

Using Sessionize for Your User Group – Part 2

By

Now that your CFS has been setup it’s time to get the word out...

Read the latest Blogs

Forums

The July Fourth Anniversary

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The July Fourth Anniversary

Independence Day 2022

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Independence Day 2022

Employee Hierarchy Recursive CTE Different Top Level Directors Overtime

By SQL_Kills

Hi, I have looked at some examples of Employee > Manager Hierarchy using Recursive...

Visit the forum

Ask SSC Logo Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers