How do I configure the client query time-out for SQL Server?

A. If you are using a utility then this is normally under file/options or tool/options from the menu. Set it to the value you require - 0 means infinite (no) timeout.

For example :-

Enterprise Manager time-out is set in TOOLS/OPTIONS/Connection/Query Timeout
Query Analyzer time-out is set in QUERY/Current Connect Options/Query Timeout

If you want to do it in C/VB code then this depends on the data access method. Look in the BOL for more details, but with raw ODBC you would use :-

etcode = SQLSetConnectAttr(m_hdbc, SQL_ATTR_CONNECTION_TIMEOUT,
(SQLPOINTER)dwSeconds, SQL_IS_UINTEGER);


Please or Register to post comments.

IT/Dev Connections

Las Vegas
September 30th - October 4th

Paul ThurottYou'll have the opportunity to experience:
• The Microsoft
Technology Roadmap
• Office 365 Implementation
• Hyper-V Optimizing
• Windows 8 Deployment
and much more!

Come See Paul Thurrott & Rod Trent in Person!

Early Registration Now Open

Upcoming Training

Mastering System Center 2012

During over 6 hours of training you can join John Savill from your computer as he will walk you through the key components and capabilities of System Center 2012, what’s involved in using the components, and the benefit they can bring to your environment.

Register Now

Current Issue

May 2013 - The NameTranslate object is useful when you need to translate Active Directory object names between different formats, but it's awkward to use from PowerShell. Here's a PowerShell script that eliminates the awkwardness.

CURRENT ISSUE / ARCHIVE / SUBSCRIBE

Windows Forums

Get answers to questions, share tips, and engage with the Windows Community in our Forums.