mcannistra (8/8/2011)
Thank you Jeff for your wonderful post.It has been extremely helpful to achieve faster speed in a test case I was creating on sql azure.
I referenced your post in the Microsoft forum where I had already started a thread before finding your precious info:
Cheers,
Mario
Thanks for the read and the feedback, Mario. Just remember... I didn't invent any of these methods (they've all been around for a very long time) especially the Cascading CTE method. That's Itzik Ben-Gan's. The only thing I did differently was to include some optimizations that a bunch of us here at SSC have added over time, one of which is the Base 10 counts. Itzik used Base 2 in his and, IIRC, was also the first to use the "TOP" optimization.
And thanks for the mention on the MSDN forum. I'm glad you could put one of the methods to good use so quickly.
--Jeff Moden
Change is inevitable... Change for the better is not.