Common Table Expressions (CTE)

SQLServerCentral Article

CTEs and Trees

  • Article

Some new interresting points about trees and CTE in SQL Server : transforming a tree from auto reference to interval model (nested sets), calculating levels in interval model, creating a view of auto ref from an interval model, hierarchical numbering of items, and more. This article includes more examples based on his previous work.

4.11 (9)

You rated this post out of 5. Change rating

2007-12-26

5,596 reads

Blogs

Why Databases Still Fascinate Me

By

I get asked a lot about why or how I began working with databases...

Monday Monitor Tips: ServiceNow Integration

By

Earlier this year I visited a customer that was using the Redgate Monitor webhook...

Inspecting TSQL Abstract Syntax Trees

By

TSQL ScriptDOM is a useful library for parsing scripts into an abstract syntax tree....

Read the latest Blogs

Forums

SQL Server 2025 Unveiled: The AI-Ready Enterprise Database with Microsoft Fabric Integration

By Site Owners

Comments posted to this topic are about the item SQL Server 2025 Unveiled: The...

Cannot get KB959420

By fabio@fullin.com.ar

Hi, we lost our sever sql2000 To restore database to a new one we...

Do You Really Need HA?

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Do You Really Need HA?

Visit the forum

Question of the Day

The New Database CheckDB

I run this code:

create database experiment
go
use Experiment
go
select DATABASEPROPERTYEX('Experiment', 'LastGoodCheckDbTime')
What is returned?

See possible answers