Udostępnij za pośrednictwem


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

  1. On the Tools menu, click Options. The Options dialog box appears.

  2. 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.

  3. Expand the Transact-SQL Editor node. The Editor Tab and Status Bar, Query Execution and Query Results nodes appear.

  4. 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).

  5. Click the Query Execution node to specify the default way queries execute.

  6. Click the Query Results node to specify the default way results are displayed.

To set options that only apply to the active Transact-SQL query window

  1. 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.

  2. Click the Execution node to set execution-related settings for the active Transact-SQL query window.

  3. Click the Results node to specify how the query results are displayed in the active Transact-SQL query window.

See Also

Tasks

How to: Execute a Query

How to: Start the Transact-SQL Editor

Concepts

Query Results Overview