SQL Server 配置文件 - 查看参数值?
在 SQL Server 配置文件中,我让它跟踪 SP:StmtStarting 事件。 “TextData”包含如下信息:
EXEC MySortedProc
@param, NULL,
@param2, NULL
我必须跟踪什么(或者我可以?)才能查看这些参数的值?
In SQL Server Profile, I have it tracing SP:StmtStarting events. The "TextData" includes information like the following:
EXEC MySortedProc
@param, NULL,
@param2, NULL
What would I have to trace (or can I?) to view the value of those parameters?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
有点害怕误解这个问题,但您可以分析 RPC:Completed 事件,该事件将返回文本数据列中存储过程执行的结果,例如:
exec usp_yourproc @param = 'value'
Somewhat scared to have misunderstood the question, but you could profile on the RPC:Completed event which will return the result for stored procedure execution in the textdata column like:
exec usp_yourproc @param = 'value'
如果我理解正确的话,您有一个存储过程被另一个存储过程调用,并且您想要获取传递给内部存储过程的参数值?
我认为 SQL Profiler 不可能做到这一点。 如果我找到方法,我会发布更新。 如果这只是为了调试,那么您可以将值保存到表中以便事后检查,但这不是一个很好的生产解决方案,除非您确实想要这种广泛的日志记录。
If I get you correctly, you have a stored procedure being called by another stored procedure and you want to get the values of your parameters that are being passed to the inner stored procedure?
I don't think it's possible with SQL Profiler. If I find a way though, I'll post an update. If this is just for debugging then you can save the values into a table to check after the fact, but that's not a very good production solution unless you really want that kind of extensive logging.
对于某些事件,SQL Profiler 将在 TextData 列中显示 NULL 值而不是真实数据。 您可以使用下面文章中解释的方法来捕获此信息。 我使用此方法捕获另一组引发排序警告的查询。 让我知道这是否有帮助。
http://sankarreddy.spaces.live.com/blog/cns! 1F1B61765691B5CD!367.entry
For some evensts, SQL Profiler will show NULL values instead of real datain TextData column. You could a metod that is explained below article to capture this info. I used this method to capture another set of queries that were throwing sort warnings. Let me know if this helps.
http://sankarreddy.spaces.live.com/blog/cns!1F1B61765691B5CD!367.entry