看看sp_execute做 [英] See what sp_execute is doing

查看:142
本文介绍了看看sp_execute做的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的MS SQL事件探查器我看到很多这些小问题。

In my MS SQL Profiler i'm seeing lots of these small queries.

EXEC sp_execute 1,@ P0 = 15954

exec sp_execute 1,@p0=15954

我知道这工作,从理论上讲,这是执行previously创建的查询,并通过特定的参数。但问题是,我不知道是什么原因导致这些查询。

I know this works, in theory, that this is executing a previously created query and passing in a specific parameter. But the problem is that i am not sure about what causes these queries.

有没有办法看到这些查询的TSQL内容?

Is there a way to see the TSQL contents of these queries?

推荐答案

这看起来像它的运行prepared查询。有一件事做的是将期待通过探查器跟踪,看看是否能找到以sp_ prepare查询了产生这种特殊的处理。

This looks like it's running a prepared query. One thing to do would be to look through the profiler trace to see if you can find the sp_prepare queries that generating this particular handle.

另一种选择,是查询系统视图,找到下面的文本。

The other option, would be query system views to find the underlying text.

这会给你的查询,如果它当前正在运行的

This will give you the query if it's currently running

select text
    from sys.dm_exec_requests
    cross apply sys.dm_exec_sql_text(plan_handle)
    where session_id = <SPID FROM PROFILER>

这篇关于看看sp_execute做的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆