How to Execute a Query in SQL Server Management Studio

Download and install the free Microsoft SQL Server Management Studio (SSMS) from the Microsoft website.

Execute a Query in SQL Server Management Studio

  1. Open Microsoft SQL Server Management Studio and connect to your SQL Server (Database Engine):
    Microsoft SQL Server Management Studio
  2. Connect to your SQL Server. If you installed the Sentinel Visualizer sample database, it is named MyPC\SENT4EXPRESS, where MyPC is your machine name. You can use Windows Authentication to connect:
    Microsoft SQL Server Management Studio server connection dialog
  3. Your connected server appears on the Object Explorer:
    Microsoft SQL Server Management Studio connected to server
  4. Select your database from the database folder.
    Microsoft SQL Server Management Studio server databases
  5. Click [New Query] on the toolbar.
    SQL Server Management Studio New Query
  6. Copy the sample SQL query by clicking the [Copy Text] button.

    SELECT * FROM Entity

    There are more examples on this webpage: Sample Queries.

  7. Paste the SQL query into the query window.
    Microsoft SQL Server Management Studio Execute Query
  8. Click the [Execute] button or press [F5] to run it. The results appear in the section below the query:
    Microsoft SQL Server Management Studio Execute Query Results
    If there were any problems with your query, error messages appear on the Messages tab.

Tips

  • Press [Ctrl] R to toggle the visibility of Results section. This gives you more room to see and write your queries.
  • You can open multiple New Query Windows.

Microsoft Certified Partner

Microsoft Partner Network

Partners Welcome

Do you provide services to government and commercial customers seeking analytic solutions?
Contact us

In-Q-Tel Portfolio Company

InQTel Portfolio Company
Learn more