Network Administration: SQL Management Studio Queries

SQL Management Studio includes a query tool that lets you type SQL commands and execute them. You can type any SQL statement you want in a query Window, and then press the Execute button to execute the query.

There are two important rules to follow when you work with queries:

  • First, each SQL statement in the query should end with a semicolon.

  • Second, you should begin the query with a USE statement that provides the name of the database.

Here’s an example of a query that follows these two rules:

use VideoStore;
select * from movies;

The USE statement indicates that the query applies to the VideoStore database, and the SELECT statement retrieves all the data from the Movies table.

To use the query tool, click the New Query button on the toolbar. Then, enter the statements for your query in the window and click the Execute button on the toolbar. The results of the query will be displayed in the window.