SQL Server Management Studio Database Engine Query Editor Window
Use the Database Engine Query Editor to create and run Transact-SQL and sqlcmd scripts.
This topic is the default location for F1 help coming from the Database Engine Query Editor window. If you select F1 after highlighting text in the editor that does not match an F help keyword applied to any Transact-SQL Reference topic, F1 help displays this topic. In that case, there are two approaches to getting additional help:
Copy and paste the editor string you highlighted into the search tab of SQL Server Books Online and do a search.
Highlight only the part of the Transact-SQL statement likely to match an F keyword applied to a topic, and select F1 again. Examples of the strings to highlight include:
The name of a Transact-SQL statement, such as CREATE DATABASE or BEGIN TRANSACTION.
The name of a built-in function, such as SERVERPROPERTY, or @@VERSION.
The name of a system stored procedure table, or view, such as sys.data_spaces or sp_tableoption.
Type scripts in the Query Editor window.
To execute scripts, press F5; or click Execute on the toolbar; or on the Query menu, click Execute. If a part of the code is selected, only that part is executed. If no code is selected, all the code in the Query Editor is executed.
To obtain help with Transact-SQL syntax, select a keyword in Query Editor, and then click F1.
For dynamic help with Transact-SQL syntax, on the Help menu, click Dynamic Help. This opens the Dynamic Help component. With Dynamic Help, help topics appear in the Dynamic Help window when keywords are typed in the Query Editor.
The Query Editor supports IntelliSense functionality, such as word and parameter completion. For more information, see Using IntelliSense.
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).
The Query Editor provides the Transact-SQL debugger that you can use to help debug Transact-SQL scripts and statements. For more information, see Using the Transact-SQL Debugger.
Errors messages are displayed in the following areas:
In a Messages tab at the bottom of the window for errors that are returned by the SQL Server Database Engine.
In the Error List window for errors that are generated by IntelliSense. For more information, see Error List Window (Management Studio).
In the Output or Immediate windows for errors that are generated by the Transact-SQL debugger.
When the Database Engine Query Editor is open, the SQL Editor toolbar appears with the following buttons.
You can also add the SQL Editor toolbar by selecting the View menu, selecting Toolbars, and then selecting SQL Editor. If you add the SQL Editor toolbar when no Database Engine Query Editor windows are open, all the buttons are unavailable.