Solved

MS SqlServer 2008 R2 "Query Timeout Expired"

Posted on 2013-12-10
1
8,405 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 40

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

752 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