SQL Profiler - 帮助过滤存储过程
有人可以帮助我提供使用 SQL Profiler 调试存储过程的完美模板吗?我已经尝试了大多数标准模板,但都产生了很多我不想看到的东西。
我想启动它运行,然后只查看存储的过程相关信息,例如它何时启动......何时停止......以及此类信息。
有没有办法只看到这一点?
Could someone assist me with the perfect template for using SQL Profiler to debug stored procs? I've tried most templates that are stanard, but all produce a lot of stuff I don't want to see.
I want to start it running, and then see only stored proc related info, such as when it started... when it stops... and that sort of info.
Is there a way to see only that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您只想获取有关其启动和停止时间的信息,则需要模板 TSQ_SP。在此模板中,您需要查看事件 SP:Starting 和 SP:Completes。您还可以添加 SQL:Starting、SQL:Completed、SQL:BatchStarting 和 SQL:BatchCompleted 事件来查找有关非 SP 查询的信息。
使用进程 ID 过滤器,如 pkk 中所述。但我更喜欢对 LoginName 使用过滤器,因为调试时您将重新创建会话,并且每次都会更改 SPID。
If you want to get just information about when it starts and stops, you need template TSQ_SPs. In this template you need to see the events SP:Starting and SP:Completes. And you can add SQL:Starting, SQL:Completed, SQL:BatchStarting and SQL:BatchCompleted events to find info about non-SP queries.
use filters for process id, as mentioned pkk. But I prefer to use filter for LoginName, because when debugging you will re-create the sessions and SPID will be changed each time.
基于此:
http://msdn.microsoft.com/en-us/library /ff650699.aspx
我会使用
SQLProfilerTSQL_SPs
或SQLProfilerTSQL
模板。如果这仍然产生太多输出,请尝试按 sql 进程 ID 进行过滤,这应该可以使用
sp_who
轻松检索。Based on this:
http://msdn.microsoft.com/en-us/library/ff650699.aspx
I would use
SQLProfilerTSQL_SPs
orSQLProfilerTSQL
template.If this still produces too much output, try filtering by sql process id, which should be easily retrived using
sp_who
.