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. 

You rated this post out of 5. Change rating

2019-11-25 (first published: )

797 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,076 reads

Blogs

The Book of Redgate: Do the Right Things

By

I do believe that Redgate has been very customer focused since it’s inception. I’ve...

How to Connect to SQL Server When Nothing Else Works – DAC

By

It's 2 AM. Your phone is going off. Users can't connect to the application,...

Get a Range of Sequence Values: #SQLNewBlogger

By

I discovered a procedure recently that I wasn’t aware of: sp_sequence_get_range. This post looks...

Read the latest Blogs

Forums

Jabatan Imigresen Certified Translators: Trusted Support for Official Documents

By nicoldavid_01

When preparing documents for immigration in Malaysia, accuracy and compliance are essential. Working with...

Let's Talk Community Events!

By Pat Wright

Comments posted to this topic are about the item Let's Talk Community Events!

that one limitation in replication

By stan

Hi as shown below a replication target requires a primary key.  if we want...

Visit the forum

Question of the Day

Detecting Deadlocks

By default, how often is the SQL Server Database Engine checking for deadlocks?

See possible answers