Microsoft OLE DB Provider for SQL Server (0x80040E31)
Timeout expired
The lines of code where is happens are executing insert or update statements
which surprised me. I could understand it more if it was a select
statement. Why is this happening. Is it refering to the Connection
Timeout, Query Timeout or some other setting? Or is it not possible to tell
from the error number? How do you set the timeout values?
Thanks.
A possible reason you get this for INSERT or UPDATE could be blocking.
Another process runs some operation which holds a table lock - that
would typically be a long-running operation.
If your application connects and disconnects, it could be a connection
timeout due to some network glitch. But in that case, you would see
this more randomly all over the application.
--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
> If your application connects and disconnects, it could be a connection
> timeout due to some network glitch. But in that case, you would see
> this more randomly all over the application.
That was my original thought, but IIS is using SQL Server installed on the
same machine.
> A possible reason you get this for INSERT or UPDATE could be blocking.
> Another process runs some operation which holds a table lock - that
> would typically be a long-running operation.
I will try putting NO_LOCK on the Select statements to see if that has any
effect.
Beware that NOLOCK can give you inconsistent and unreliable results. If
you are on SQL 2005, you may be interesting in using snapshot isolation
or read committed snapshot.