Glen - I love this article. Amazing stuff. I read some of it and skimmed the rest but can't wait until I have time to play with your code a bit more. Well done sir!
"I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."