Ron Harlev
Ron Harlev

Reputation: 16663

How to find timed out statements in SQL 2005 profiler

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

Upvotes: 8

Views: 6839

Answers (3)

gbn
gbn

Reputation: 432180

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.

Upvotes: 1

John Lemp
John Lemp

Reputation: 5067

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).

Upvotes: 0

jons911
jons911

Reputation: 1836

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).

Upvotes: 8

Related Questions