Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Query timeout expired

Author  Topic 

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2011-01-30 : 06:50:22
I keep getting from an asp application:

Microsoft OLE DB Provider for ODBC Drivers error '80040e31'

[Microsoft][ODBC SQL Server Driver]Query timeout expired

if I write out the update statement and copy and paste to SSMS it runs in a second -- what could be the problem?

dataguru1971
Master Smack Fu Yak Hacker

1464 Posts

Posted - 2011-01-30 : 08:10:21
How long does it take before the timeout expires? what is the source of the connection?



Poor planning on your part does not constitute an emergency on my part.
Go to Top of Page

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2011-01-30 : 08:25:34
it's a connection through asp

from asp it seems to be taking 2 minutes but I did response.write sql and ran that sql directly in ssms and it went in a second

it seems to happen specifically with this update statement - i'm not having problems with a select statement using the same connection
Go to Top of Page

dataguru1971
Master Smack Fu Yak Hacker

1464 Posts

Posted - 2011-01-30 : 11:21:43
Could there be an existing table lock on the table due to your connection? Sounds like that might be the cause...you connect to the table, which locks it, then tries to update it with an lock...?



Poor planning on your part does not constitute an emergency on my part.
Go to Top of Page

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2011-01-30 : 12:29:37
I am looping through at the same time with a different recorset -- could that be the problem? I do need to loop through and then update specific records
Go to Top of Page

dataguru1971
Master Smack Fu Yak Hacker

1464 Posts

Posted - 2011-01-30 : 12:42:12
Could be..you have a recordset open and are trying to update it.

this may prove to be useful reading: http://www.sql-server-performance.com/tips/reducing_locks_p1.aspx





Poor planning on your part does not constitute an emergency on my part.
Go to Top of Page
   

- Advertisement -