在SQL 2008 Management Studio中调试时,在存储过程中查询临时表 [英] Query temp table in stored proc whilst debugging in SQL 2008 Management Studio
问题描述
我在SQL 2008 Management Studio中进行调试,可以使用观察窗口查询本地参数,但是如何在调试时查询临时表?
如果不可能有另外一种方法?我已经阅读了关于使用表变量,可以查询这些吗?如果是,我该怎么做?
使用全局临时表,即使用双哈希。
insert into ## temp select ...
调试时可以暂停SP,而在另一查询窗口中可以查询##表。
select * from ## temp
单个哈希表(#tmp)是会话具体且仅在会话中可见。
I have a really large stored procedure which calls other stored procedures and applies the results into temp tables.
I am debugging in SQL 2008 Management Studio and can use the watch window to query local parameters but how can I query a temp table on whilst debugging?
If its not possible is there an alternative approach? I have read about using table variables instead, would it be possible to query these? If so how would I do this?
Use global temporary tables, i.e. with double hash.
insert into ##temp select ...
While debugging, you can pause the SP at some point, and in another query window, the ## table is available for querying.
select * from ##temp
Single hash tables (#tmp) is session specific and is only visible from the session.
这篇关于在SQL 2008 Management Studio中调试时,在存储过程中查询临时表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!