views:

47

answers:

2

Hi, we have a stored procedure that ran fine until 10 minutes ago and then it just hangs after you call it.

Observations:

  • Copying the code into a query window yields the query result in 1 second
  • SP takes > 2.5 minutes until I cancel it
  • Activity Monitor shows it's not being blocked by anything, it's just doing a SELECT.
  • Running sp_recompile on the SP doesn't help
  • Dropping and recreating the SP doesn't help
  • Setting LOCK_TIMEOUT to 1 second does not help

What else can be going on?

+1  A: 

Run Adam Machanic's excellent sp_WhoIsActive stored proc while your query is running. It'll give you the wait information - meaning, what the stored proc is waiting on - plus things like the execution plan:

http://www.brentozar.com/archive/2010/09/sql-server-dba-scripts-how-to-find-slow-sql-server-queries/

Brent Ozar