Skip to content

Home / 001_Getting_Started_with_SQL_Server / 001.003.Connect_to_the_SQL_Server

001.003. Connect to the SQL Server

1. Connect to SQL Server Using SSMS

To connect to SQL Server using Microsoft SQL Server Management Studio, follow these steps:

Step 1: Launch SSMS

Open Microsoft SQL Server Management Studio from your Start menu or desktop shortcut.

SSMS-connect-to-SQL-Server

Step 2: Open the Connection Dialog

In Object Explorer, click Connect > Database Engine.

Open-the-Connection-Dialog-300x213

Step 3: Enter Server Connection Details

  • Server Type: Database Engine
  • Server Name: localhost
  • Authentication: SQL Server Authentication
  • Login: sa
  • Password: (Enter the password you set during installation)
  • Remember Password: Check
  • Encryption: Optional

Click Connect.

Connect-to-Local-Server-Server

If successful, you’ll see the Object Explorer panel listing your SQL Server instance.

Connect-Microsoft-SQL-Server-Management-Studio


2. Execute a Query

Follow these steps to execute a query:

Step 1: Open a New Query Window

In Object Explorer, right-click the connected server node (e.g., localhost (SQL Server...)) and select New Query.

New-Query

Step 2: Enter the SQL Query

SELECT @@VERSION;

This query returns the version of SQL Server currently running.

Step 3: Run the Query

Click the Execute button or press F5.

The Results window will display the SQL Server version.

SSMS-Execute-a-Query


Conclusion

You’ve now successfully connected to a SQL Server instance and executed a query using SQL Server Management Studio.