Entering and Executing Queries
A batch file (or script) is a collection of Transact-SQL statements used to perform a task. Scripts, stored as files, form a foundation for many server application projects. Definitions of tables, indexes, and stored procedures, as well as reports and batch jobs, are usually stored in script files.
Once you make a connection to a server, click the Database drop-down list and click the name of the database with which you want to work. You can enter queries in a number of ways. To execute a query, click the Go button on the toolbar, or select Execute Query from the Query menu.
Click the History icon
. In the History
Window, highlight the statement(s) you want to execute, then click Go
on the button bar of the connection window. You can also use Ctrl+c
to copy statements from the History Window, then use Ctrl+v
to paste the statement(s) to the Input Window.
The ResultSets display in the Output Window.