Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Timeout when I call a stored procedure in SQL Server 2008

From C# with EF, I call a long stored procedure with ExecuteStoreCommand

30 sec after the procedure starts, I have a timeout exception.

How can I configure timeout ? On the server or in my C# client ?

Thanks

like image 280
Patrice Pezillier Avatar asked Oct 27 '10 13:10

Patrice Pezillier


1 Answers

You could set the CommandTimeout on the underlying connection, but a much, much, much better idea would be to take the time and effort to diagnose why the timeout is happening in the first place.

Even if you "solve" the problem by upping your CommandTimeout, you could potentially be causing other blocking issues in your database. Look for blocking queries or poor query plans, or badly designed tables and indexes instead.

like image 67
Dave Markle Avatar answered Sep 23 '22 14:09

Dave Markle