CTE

SQLServerCentral Article

Navigating Trees With CTE

  • Article

Introduction This article shows how common table expressions (CTE) in SQL Server are naturally suited for navigating trees, such as finding its longest path, or diameter. Recall that a tree is an undirected graph where unique paths exist between any two nodes (i.e. vertices). Any node may be selected as its top node, with its […]

4.8 (5)

You rated this post out of 5. Change rating

2021-04-19

7,290 reads

Blogs

What Does Redgate Test Data Manager Do?

By

At the PASS Data Community Summit in 2024, Redgate launched Test Data Manager (TDM),...

Extracting PostgreSQL database metadata for presentation in Excel format

By

(2024-Mar-16) I have been a big fan of using the Excel application for various tasks...

Change Notebook Spark Session Time-Out in Microsoft Fabric

By

You might know the feeling: you’re writing code in a Notebook in Microsoft Fabric...

Read the latest Blogs

Forums

case for 'DBCC TRACEON - Trace Flags'

By VAI

Please share a situation when enabling and taking further advantage of DBCC TRACEON -...

EXEC (@SQL) AT QASERVERNAME; Fails with read-only database error.

By sgmunson

All, Need a linked server guru.   Trying the following in a stored procedure: SET...

ACCIDENTAL DUPLICATE...

By sgmunson

Accidental Duplicate...  my bad...

Visit the forum

Question of the Day

SQL Express Agent

How can I run SQL Agent with SQL Server Express 2022?

See possible answers