Export (0) Print
Expand All
Expand Minimize

SET QUERY_GOVERNOR_COST_LIMIT (Transact-SQL)

Updated: 17 July 2006

Overrides the currently configured query governor cost limit value for the current connection.

Topic link icon Transact-SQL Syntax Conventions


SET QUERY_GOVERNOR_COST_LIMIT value

value

Is a numeric or integer value specifying the longest time in which a query can run. If you specify a nonzero, nonnegative value, the query governor disallows execution of any query that has an estimated cost exceeding that value. Specifying 0 (the default) for this option turns off the query governor, and all queries are allowed to run indefinitely.

"Query cost" refers to the estimated elapsed time, in seconds, required to complete a query on a specific hardware configuration.

Using SET QUERY_GOVERNOR_COST_LIMIT applies to the current connection only and lasts the duration of the current connection. Use the query governor cost limit option of sp_configure to change the server-wide query governor cost limit value. For more information about configuring this option, see sp_configure and Setting Server Configuration Options.

The setting of SET QUERY_GOVERNOR_COST_LIMIT is set at execute or run time and not at parse time.

Requires membership in the public role.

Release History

17 July 2006

Updated content:
  • Corrected the required permissions.

14 April 2006

Updated content:
  • Clarified the definition of value.

Community Additions

ADD
Show:
© 2014 Microsoft