Saturday, September 10 2005

It's an oldie but a goody, but if you've ever had the need to do any sort of performant querying on branches of a tree, take a look at my article on SQL Hierarchies. I've gotten a lot of great feedback regarding it, and it still seems to be serving a lot of people's needs.

Of course SQL Server 2005 brings Common Table Expressions, which offers a syntactically easier method of querying hierarchies, but it still relies upon recursive looping to build its set, whereas the technique I detail can build a response set using a very high performance index backed operation.

 SQL 
   

Reader Comments

Add Comment

Name *:

Email Address:

(your email address is not displayed)
Website:

Comment *:



About the Author
Dennis Forbes Dennis Forbes is a Toronto-based software architect. While focused primarily on the .NET and SQL Server worlds, Dennis frequently ventures outside of this comfort zone into game development and image processing. He has been published in several industry magazines, has been quoted in the Wall Street Journal and has been interviewed by NPR.

He is a vice president and lead software architect at an innovative New York City hedge fund back-office services firm.

Dennis has been working on solutions for the financial, telecommunications, and power generation markets for over 15 years.





 

Dennis Forbes