Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MS SqlServer 2008 R2 "Query Timeout Expired"

Posted on 2013-12-10
1
Medium Priority
?
9,330 Views
Last Modified: 2013-12-11
I have a query that runs a remote machine.  It queries our DB for approx 145 rows of data and when run locally in the management console on the server it takes about 45 seconds to complete. We use this for our AR statements.  When I look at the Sql Server Connections property, the "Remote Query Timeout" value = 600.  When I run the query from the remote server using an ODBC driver I get the following message: Sql error: ERROR [HYT00][Microsoft][Sql Server Native Client 10.0]Query timeout expired.
Any help would be appreciated.
0
Comment
Question by:Daves166
1 Comment
 
LVL 40

Accepted Solution

by:
lcohan earned 900 total points
ID: 39709403
You can set the connection timeout by setting the SQL_ATTR_CONNECTION_TIMEOUT connection attribute with SQLSetConnectAttr.

You can set the statement query timeout by setting the SQL_ATTR_QUERY_TIMEOUT statement attribute with SQLSetStmtAttr().

http://msdn.microsoft.com/en-us/library/ms811006.aspx
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Loops Section Overview
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question