Debugging dynamic sql + dynamic tables in MS SQL Server 2008.
- by Hamish Grubijan
Hi, I have a messy stored procedure which uses dynamic sql.
I can debug it in runtime by adding print @sql; where @sql; is the string containing the dynamic SQL, right before I call execute (@sql);.
Now, the multi-page stored procedure also creates dynamic tables and uses them in a query. I want to print those tables to the console right before…