Welcome to Sol 3 Sign in | Join | Help
CS Search | Live Search Search

Sol 3

Home of Barrows Software Solutions, LLC

Keith Barrows

Subjects range from Personal to Technical.

SQL Server and Trees (or hierarchical data)

I've been handling hierarchical data in SQL for many, many, many years now.  About 6 years ago I came across some articles by a guy named Joe Celko.  By numbering a left and right side to each node in a tree he describes a way to deal with hierachical data in a very direct way.  The following are some of the articles:
If you do a google search you will find many such articles.  The other thing I would like to point out is the above solution as done in SQL 2005 now carries even more weight.  You have the use of .NET Framework within SQL Server with full CLR support.  This means you can write a CLR based sproc that has the use of full blown arrays to do some of the trickier INSERTs and DELETEs.

SQL 2005 has introduced a new way at looking at hierarchical data - Common Table Expressions.  I will be the first to admit that I am not up to speed on SQL 2005.  I've yet to have a client willing to move to SQL 2005 so everything I still do is on SQL 2000 (or Oracle, etc).  However, this is some slick technologies here and well worth the research.
So, with a lot of data out there for sulutions there should be no problems implementing a tree solution in the SQL language.
Published Wednesday, August 16, 2006 11:43 AM by Keith Barrows
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
(optional)
(required) 
Submit

About Keith Barrows

I've been in computing since 1975. I started on an old PDP-8J with 3k of memory and 2 teletypes. I learned BASIC and Octal based assembly. I later moved into CPM, TR-DOS, Apple and finally into PC-DOS, Dr DOS and MS-DOS. I've been a beta tester for over a decade, got into web applications as a means to handle B2B requirements and have specialized in data movement between applications and businesses since. I have been a MVP, ASP Elite and was selected by Microsoft as one of the original 15 board members for ASPInsiders.
CS Build: 2.1.61129.2
1999
Listed on the CS Listings Powered By Community Server Themed by nb development