SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Query timeout expired
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

esthera
Flowing Fount of Yak Knowledge

1388 Posts

Posted - 01/30/2011 :  06:50:22  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

USA
1464 Posts

Posted - 01/30/2011 :  08:10:21  Show Profile  Send dataguru1971 an AOL message  Send dataguru1971 a Yahoo! Message  Reply with Quote
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
Flowing Fount of Yak Knowledge

1388 Posts

Posted - 01/30/2011 :  08:25:34  Show Profile  Reply with Quote
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

Edited by - esthera on 01/30/2011 08:59:10
Go to Top of Page

dataguru1971
Flowing Fount of Yak Knowledge

USA
1464 Posts

Posted - 01/30/2011 :  11:21:43  Show Profile  Send dataguru1971 an AOL message  Send dataguru1971 a Yahoo! Message  Reply with Quote
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
Flowing Fount of Yak Knowledge

1388 Posts

Posted - 01/30/2011 :  12:29:37  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

USA
1464 Posts

Posted - 01/30/2011 :  12:42:12  Show Profile  Send dataguru1971 an AOL message  Send dataguru1971 a Yahoo! Message  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000