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,

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.