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

8,018 reads

Blogs

Truncate Table Pitfalls

By

 Truncate Table Pitfalls Truncating a table can be gloriously fast—and spectacularly dangerous when used carelessly....

dataMinds Connect 2025 – Slides & Scripts

By

You can find all the session materials for the presentation “Indexing for Dummies” that...

“SQL Server Is Slow” Part 4 of 4

By

Parts 1, 2 and 3 got you to the (SQL) engine room. Now we...

Read the latest Blogs

Forums

ERD Tools recommendation

By Coffee_&_SQL

Hey All, I'm looking for a free ERD tool. Does anyone have any recommendations?...

Stairway to Azure SQL Hyperscale – Level 3: RBPEX Caching Layer Internals

By Chandan Shukla

Comments posted to this topic are about the item Stairway to Azure SQL Hyperscale...

Vector Datatype Dimensions

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Vector Datatype Dimensions

Visit the forum

Question of the Day

Vector Datatype Dimensions

The new vector datatype in SQL Server 2025 requires a number dimension parameter. What is the maximum number of dimensions supported?

See possible answers