Tuesday, October 28, 2014

Geeting TIMEOUT while executing a Stored Procedure.

If you are executing a stored procedure within SSMS it uses the command timeout of SSMS from Tools -> Options -> Query Execution -> Execution time-out.


If you are using code to execute it you need to set the .Timeout property (e.g. of SQLCommand) either to zero or something "large".


Generally setting timeout to zero is not a good idea. Something will break, or lock or even worse... dead-lock sooner or later.


See if you're recursively calling the stored procedure by mistake. Infinite loops should also be in your checklist. Common things to check are indexes, forgotten where clauses, cartesian products, locks.


To get more help you should post your stored procedure and objects it references plus at least some estimate of a row count.




"If there's nothing wrong with me, maybe there's something wrong with the universe!"


No comments:

Post a Comment