How to find timed out statements in SQL 2005 profiler

丶灬走出姿态 提交于 2019-12-21 12:18:45

问题


I'm trying to find SQL statements that timed out using the SQL 2005 profiler. Is there a way to set such a filter?


回答1:


In Profiler, you can add the event "Attention" under "Errors and Warnings". It's definition is

Collects all attention events, such as client interrupt request or when a client connection is broken.

As far as other errors (deadlocks, contraints, etc), try "Execution Warning" (reports warning that occurred during the execution of SQL statement or procedure) or "User Error Message" (the error message displayed to the user in the case of an error or exception).




回答2:


Yes.

  • Check "All Events"
  • Go to the lock section
  • Specify the "lock: Timeout" events

Lock event in Books Online

Now, this works with server side locks (@@LOCK_TIMEOUT <> 0). I don't know if a client side timeout will be trapped.




回答3:


One option, if you know what your client configured timeouts are set to (ie. 30 seconds by default), you can set a filter on your trace to only collect events with a duration greater than or equal to your timeout (minus a second or two).



来源:https://stackoverflow.com/questions/279073/how-to-find-timed-out-statements-in-sql-2005-profiler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!