Solved

MS SqlServer 2008 R2 "Query Timeout Expired"

Posted on 2013-12-10
1
7,845 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 39

Accepted Solution

by:
lcohan earned 300 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

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 …
Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

947 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now