• TUellner (7/16/2013)


    Thanks all. I know it's not useful for anything other than a teaching tool. I was hoping to get to the execution of the dynamic SQL mess at the end just out of savage curiosity.

    -Tom

    Well that's a lot easier. Just change the exec/sp_executesql at the bottom of the SQL to a print, run the loop without generating plans and copy the SQL at the bottom to run in isolation.