SQL Server Management Studio code editors include the following features:

Templates that can be used to speed authoring of scripts for scripts for SQL Server Database Engine, Analysis Services, and SQL Server Compact 3.5 SP2. Templates are files that include the basic structure of the statements needed to create objects in a database.

Color coding of syntax to improve the readability of complex statements.

A graphical query designer for drag-and-drop creation of queries.

Presentation of query windows as either tabs in the document window, or in separate documents.

Presentation of query results in either a grid or text window or redirected to a file.

Display of result grids as separate tabbed windows.

Graphical display of Showplan information showing the logical steps built into the execution plan of a Transact-SQL statement.

A feature-rich text editing environment supporting find and replace, bulk commenting, custom fonts and colors, and line numbering. Some types of editors contain additional features like outlining and auto-complete.

SQLCMD Mode for executing scripts with operating-system commands.

When you select this option, be aware of the following limitations:

IntelliSense in the Database Engine Query Editor is turned off.

Because Query Editor does not run from the command line, you cannot pass in command-line parameters such as variables.

Because Query Editor cannot respond to operating-system prompts, you must be careful not to run interactive statements.

Note

Enabling IntelliSense for large Transact-SQL scripts can reduce the performance of slow computers. For information about how to limit the size of Transact-SQL scripts for which IntelliSense is enabled, see Options (Text Editor/Transact-SQL/IntelliSense).

Results. This window is used to view the results of a query. The window can display the results in grid or in text.

Messages. This window displays errors, warnings, and informational messages that are returned by the server when a script is run. The list of messages does not change until the script is run again.

Error List. This window displays syntax and semantic errors found by the IntelliSense feature in the Database Engine Query Editor. The list of errors changes dynamically as you edit Transact-SQL scripts. The Error List only displays errors from the Database Engine Query Editor; it does not display errors from the other editors.

Client Statistics. This window displays information about the query execution grouped into categories. When Include Client Statistics is selected from the Query menu, a Client Statistics window is displayed upon query execution. Statistics from successive query executions are listed along with the average values. Select Reset Client Statistics from the Query menu to reset the average.

To access a SQL Server Management Studio Query Editor

Click the type of query you want to create. For example, to create a Transact-SQL Query, click Database Engine Query.

The Query Editor window appears.

On the SQL Server Management Studio toolbar, click the button for the query editor that you want to open. For example, to create an XMLA query, click Analysis Services XMLA Query.

The Query Editor window appears.

To access the Database Engine Query Editor from Template Explorer

On the View menu, click Template Explorer.

The Template Explorer window appears in the lower right.

Double-click a template to open a Database Engine Query window with the text of the template. For example, to open a CREATE DATABASE template, open the SQL Server Templates folder, open the Databases folder, and double-click create database.

To view the code editor in full-screen mode

In a code editor window, press SHIFT+ALT+ENTER, to toggle in and out of full-screen mode.

To view the Management Studio Error List window

To view the Management Studio Error List window, you can use either of the following methods: