Home Dashboard Directory Help
Search

SQL Debugging - All About Tables: Table Variables, #Temp, ##Global Temp, Source (Input) and Output Tables by DB007


Status: 

Closed
 as Postponed Help for as Postponed


14
0
Sign in
to vote
Type: Suggestion
ID: 334684
Opened: 3/27/2008 2:20:47 AM
Access Restriction: Public
1
Workaround(s)
view

Description

When debugging a stored procedure that contains temporary tables, @table_variables or source (input)/output(destination) tables - it is currently extremly difficult to find out what data is being populated into these variables/or from input.

We need a mechanism to be able to display the contents of these tables, as they are often extremly key to the actual working of procedure being debugged.

This certainly makes debugging interesting, having to take a procedure for debug currently and sticking lots of select * from <source_objects> into a procedure, which then has to be removed after debug is finished. Would be nice to save a lot of time to faciliate data table debugging.
Details
Sign in to post a comment.
Posted by DB007 on 4/1/2008 at 2:27 AM
Thanks Jim.
Posted by Microsoft on 3/31/2008 at 9:45 AM
Hi DoButton,

Thanks for the feedback. As you noted, VS2008 does not have support for viewing SQL tables while debugging. We will certainly consider it in a future release of Visual Studio.

Jim Griesmer
Visual Studio Debugger
Sign in to post a workaround.
Posted by Filip De Vos on 8/1/2011 at 2:28 AM
I built a procedure which will display the content of a temp table from another database connection. (which is not possible with normal queries).
Note that it uses DBCC PAGE & the default trace to access the data so only use it for debugging purposes.

https://github.com/FilipDeVos/sp_select

To use it while debugging put a breakpoint somewhere in your procedure, open a second connection and query the temp table with:
exec sp_select 'tempdb..#mytable'