How do I configure the client query time-out for SQL Server?
Neil Pike
January 24, 2000
1 Min Read
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);
About the Author
Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
You May Also Like