• Nicely done. Hats off to sticking with TSQL for the solution.

    Good example with lots of step by step help.

    IMHO while other languages have features, TSQL is server based and minimal network traffic. And it's a single point of non-dll-hell for maintenance.

    And forget inefficiencies. Cursors, table variables, UDFs, and loops just further what we can already do. Who here has to worry that hardware will ever not support us reaching for nested cursors because were not as geeky as some of our more gifted contemporaries....

    By the way some of my procs do go to 8,000 lines to do report writer stuff. I simply create a target table and keep appending flushed out summaries and special sort coded fields for a final pretty output.

    So thanks again for yet another way to TSQL ginsui guru slice and dice!!!