How to diagnose what is causing DB timeouts I'm a web developer which currently has the joy of managing a client website that is still using Classic ASP that uses SQL Server 2000.

The code is quite old and in the process of been updated to a completely new system but in the interim we have to keep the websites running as smooth as possible.

There are three sites, a commercial front end, UK backend and Singapore back end. The two backends have a nearly 95% identical code base and each has a database on the same server and are hosted on the same machine.

MY issue is that for the last two or three days there have been errors for users when they try to log in on the Singapore website, the error is:

Microsoft OLE DB Provider for ODBC Drivers error '80040e31' 
[Microsoft][ODBC SQL Server Driver]Timeout expired 


The code in question is a simple UPDATE statement, updating a session variable for one entry and the code has been running fine for many years.

There have been no recent code changes either that would affect this. How can I diagnose what is causing the bottleneck, EventViewer, SQL Error logs and IIS logs seem to not show errors around the time the timeout occurred.

My guess that the error is occurring when this code tries to run the UPDATE but there was/is an earlier process choking the SQL Server, but not been a DBA I am only guessing at this point.

Many thanks
John
I struglled with this issue for one week. 

A the beginning, I started with a 45 seconds query for which the timeout  error message was relevant. I reduced the execution time to 3 seconds and had still the error.

While seraching the Internet, I found out many cases telling the message itself is not relevant, and for this reason, my further investigations were made in other directions. I tried many workarounds I found in many forums without success.

Within my ASP code, I'm using a ADODB.Command object. This object has a CommandTimeout property expected to have a 30 seconds value. I tried to setup the value to 0, which means an unlimited timeout and I had no more the 80040e31 error. Then I tried a 30 value, and again, it worked.

For some reasons, it looks like the defalut value for the CommandTimeout of the ADODB.Command moved to another value. Setting up this value back to the expected default value solves the issue.

Hope it will work for you too.

Yvzs