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. 

2019-11-25 (first published: )

485 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,472 reads

Blogs

Creating TAIL on Windows for Text Files

By

I wrote recently about making a HEAD utility to find the top few lines...

Daily Coping 17 Aug 2022

By

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

The book that made me love goal-setting

By

Pete Wilkinson’s book “Unstoppable” finally made visualizations and goals make sense to me. Here's a...

Read the latest Blogs

Forums

SQL Query

By akhil

Hi, I'm struggling to solve this problem....I hope will get a answer here. count,...

Combine or join 3 tables, 1 for each databases

By pedroccamara

Hello guys, I hope you're all great and healthy I would love to learn...

SQL Tables Not Updating After Inserting New Rows

By carlton 84646

The following code creates a table with the following watermark_value column: DROP TABLE IF...

Visit the forum

Ask SSC Logo Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers