SQL Server Profiler 中的存储过程输出参数 [英] Stored procedure output parameters in SQL Server Profiler

查看:62
本文介绍了SQL Server Profiler 中的存储过程输出参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有 int 输出参数的存储过程.如果我运行 SQL Server Profiler,通过一些 .Net 代码执行存储过程,并捕获 RPC:Completed 事件,则 TextData 如下所示:

I've got a stored procedure with an int output parameter. If I run SQL Server Profiler, execute the stored procedure via some .Net code, and capture the RPC:Completed event, the TextData looks like this:

declare @p1 int
set @p1=13
exec spStoredProcedure @OutParam=@p1 output
select @p1

为什么看起来像是在执行存储过程之前获取了输出参数的值?

Why does it look like it's getting the value of the output parameter before executing the stored procedure?

推荐答案

RPC:Completed 事件类指示远程过程调用已完成.所以此时输出参数实际上是已知的.看看跟踪 RPC:Started 是否显示了您的期望.

The RPC:Completed event class indicates that a remote procedure call has been completed. So the output parameter is actually known at that point. See if tracing the RPC:Started shows you what you expect.

这篇关于SQL Server Profiler 中的存储过程输出参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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