How to: Set Options for Query Execution and Results
You can set options to control how your scripts and queries are executed in the Transact-SQL editor. For example, you can restrict how many rows will be returned or how long to wait for results. You can set default options that apply to all new editor sessions that are created but do not affect existing instances of the Transact-SQL editor. You can also override those settings and set options that only apply to the active Transact-SQL editor session.
To set default options for all new Transact-SQL query windows
On the Tools menu, click Options. The Options dialog box appears.
Locate and expand the Database Tools node. If you do not see the Database Tools node, check Show all settings at the bottom-left corner of the Options dialog box. After expanding the Database Tools node, the Transact-SQL Editor node appears.
Expand the Transact-SQL Editor node. The Editor Tab and Status Bar, Query Execution and Query Results nodes appear.
Click the Editor Tab and Status Bar node to specify how the Transact-SQL query editor should present status bar content, status bar layout and colors, and tab text. For more information, see Transact-SQL Editor Options (Editor Tab and Status Bar).
Click the Query Execution node to specify the default way queries execute.
The General node. This node contains settings that relate to row counts, text size, time-outs, and batch separators. For more information, see Transact-SQL Editor Options (Query Execution/General).
The Advanced node. This node contains more advanced settings, such as deadlock priority and lock time-outs. For more information, see Transact-SQL Editor Options (Query Execution/Advanced).
The ANSI node. This node contains settings that collectively specify SQL-92 standard query execution behavior. For more information, see Transact-SQL Editor Options (Query Execution/ANSI).
Click the Query Results node to specify the default way results are displayed.
The General node. Allows you to specify if new windows should display results to grid, text, or file. For more information, see Transact-SQL Editor Options (Query Results/General).
The Results to Grid node. Specify advanced options for displaying results to grid. For more information, see Transact-SQL Editor Options (Query Results/Grid).
The Results to Text node. Specify advanced options for displaying results to text. For more information, see Transact-SQL Editor Options (Query Results/Text).
To set options that only apply to the active Transact-SQL query window
On the Data menu, click Query Options. You can also right-click the Transact-SQL editor and select Query Options. The Query Options dialog box appears.
Click the Execution node to set execution-related settings for the active Transact-SQL query window.
The General node. This node contains settings that relate to row counts, text size, time-outs, and batch separators. For more information, see Transact-SQL Editor Options (Query Execution/General).
The Advanced node. This node contains more advanced settings, such as deadlock priority and lock time-outs. For more information, see Transact-SQL Editor Options (Query Execution/Advanced).
The ANSI node. This node contains settings that collectively specify SQL-92 standard query execution behavior. For more information, see Transact-SQL Editor Options (Query Execution/ANSI).
Click the Results node to specify how the query results are displayed in the active Transact-SQL query window.
The Grid node. Specify the options for displaying the result set in grid format. For more information, see Transact-SQL Editor Options (Query Results/Grid).
The Text node. Specify the options for displaying the result set in text format. For more information, see Transact-SQL Editor Options (Query Results/Text).
See Also
Tasks
How to: Start the Transact-SQL Editor