Stored procedures are timing out intermittently!

Management studio sets an infinite timeout on queries/commands it runs. Your database connection from code will have a default timeout which you can change on the command object.


Try to recompile these procedures. I've such problems few times and didn't find the cause of problem, but recompiling always helps.

EDIT:

To recompile proc, you go to management studio, open procedure to modify and hit F5 or execute: EXEC sp_recompile 'proc_name'


This can often relate to:

  • bad query plans due to over-eager plan-reuse (parameter sniffing)
  • different SET options - in particular ANSI_NULLS and CONCAT_NULL_YIELDS_NULL
  • locking (you might have a higher isolation level)
  • indexing needs to be rebuilt / stats updated / etc

The SET options can lead to certain index types not being usable (indexes on persisted calculated columns, for example - including "promoted" xml/udf queries)