views:

41

answers:

1

I'm currently debugging an Ms SQL Function (SQL 2008).

In this function, I have a variable declared this way:

DECLARE @TempTable TABLE ( Id INT UNIQUE );

Then, I insert some records using an insert into...select statement.

When debugging, I would like to see the records in this table.

Is there a way to do this?

Thanks

+1  A: 

One possible solution, that may not be the best, is to:

  • Create a permanent table that is the same as the temporary table
  • Modify the function so that it dumps the data from the temporary table into the permanent table at the point where the temp table contains the data you're interested in seeing

When the function ends, open up the new permanent table and you'll have a copy of the temporary table's state.

This requires that you have permission to create new tables and modify the function.

Ant
I was afraid of that. I really thought that I could see the table`s content within the debugger. I'll try your way.
vIceBerg