02. Installing SQL Server & SSMS
Level: Beginner
- Download SQL Server Developer Edition (completely free)
- Install SQL Server step-by-step
- Download & install SSMS (SQL Server Management Studio)
- Connect to your SQL Server
- Verify installation with first database
- Troubleshoot common installation issues
Before writing any T-SQL queries, you need:
- SQL Server -- the database engine (what stores data)
- SSMS -- the visual tool (how you write & test queries)
Both are completely free for learning. Let's install them.
What You're Installing
| Software | What It Does | Version to Install |
|---|---|---|
| SQL Server | Database engine that stores data | Developer Edition 2022 (free) |
| SSMS | Visual tool to write SQL queries | Latest (free) |
Step 1: Download SQL Server Developer Edition
SQL Server comes in 2 versions:
- Express -- Limited, learning only
- Developer Edition -- Full features, free for learning & development
- Enterprise -- Paid, for production
We use Developer Edition.
Windows Installation
- Go to: https://www.microsoft.com/sql-server/sql-server-downloads
- Click "Download SQL Server 2022 Developer Edition" (or latest)
- Choose "Developer Edition" (not Express)
- Save the installer
Mac / Linux Installation
SQL Server on Mac/Linux requires Docker or Azure:
# Option 1: Docker (easiest)
docker pull mcr.microsoft.com/mssql/server
# Option 2: Use Azure SQL Database (cloud version)
# Free tier available at portal.azure.com
Recommendation: Mac/Linux users -> use Docker or Azure. Much simpler than traditional installation.
Step 2: Install SQL Server (Windows)
- Run the installer you downloaded
- Choose "Custom" installation
- Select features:
- [OK] Database Engine (required)
- [OK] Analysis Services (optional)
- Reporting Services (skip for now)
- Instance name: Leave as "MSSQLSERVER" (default)
- Authentication:
- Select "Mixed Mode"
- Set admin password (remember this!)
- Click "Install"
Wait: Installation takes 5-10 minutes.
[OK] SQL Server installation complete
[OK] SQL Server started automatically
[OK] You're ready for next step
Step 3: Download & Install SSMS
SSMS is the visual interface where you write SQL queries. It's free.
- Go to: https://learn.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms
- Click "Download SSMS" (latest version)
- Run the installer
- Click "Install" (use default settings)
- Restart your computer when prompted
[OK] SSMS installation complete
[OK] You're ready to connect to SQL Server
Step 4: Connect to SQL Server via SSMS
- Open SSMS (search in Start menu)
- You'll see "Connect to Server" dialog:
- Server name:
(local)orlocalhostor. - Authentication: Windows Authentication (default)
- Server name:
- Click "Connect"
[OK] Connected to SQL Server
[OK] You're ready to create your first database
Step 5: Create Your First Database (School Management)
Right-click "Databases" in left panel:
- New Database
- Database name:
SchoolManagement - Click "OK"
[OK] Database created: SchoolManagement
[OK] Ready for School Management System tables
Verify Installation: Write First Query
In SSMS, paste this query in the editor:
-- Check SQL Server version
SELECT @@VERSION AS 'SQL Server Version';
-- Output:
-- Microsoft SQL Server 2022 (RTM) - 16.0.4125.3 ...
Click "Execute" (or press F5).
If you see the version number: [OK] Installation successful!
Troubleshooting
| Problem | Solution |
|---|---|
| "Cannot connect to server" | Restart SQL Server: Control Panel -> Services -> SQL Server |
| "Login failed for user" | Check admin password set during installation |
| SSMS installation hangs | Download latest SSMS version manually |
| "Port 1433 already in use" | Another app using port. Change SQL Server port in config |
Common Installation Mistakes
Mistake 1: Installing Express Edition instead of Developer Edition
Wrong: Download SQL Server Express (smaller, limited)
Result: Missing features. Limited database size (10GB max). Can't practice advanced features.
Fix: Always download Developer Edition (free, full features). Go to https://www.microsoft.com/sql-server/sql-server-downloads and explicitly choose "Developer Edition", not "Express".
Mistake 2: Choosing Windows Authentication only (not Mixed Mode)
Wrong: Skip "Mixed Mode" during installation. Only use Windows Authentication.
Result: Cannot login with SQL username/password later. Limited to Windows account only. Breaks learning when you need to practice SQL logins.
Fix: During Step 2, in Authentication section, select "Mixed Mode". Then set admin password. This allows both Windows Authentication AND SQL Server Authentication.
Mistake 3: SSMS Installation Hangs or Fails
Wrong: Download SSMS, installer stalls halfway. Computer freezes.
Result: Cannot proceed. SSMS never installs properly.
Fix:
- Kill installer (Task Manager)
- Uninstall SSMS completely (Control Panel -> Programs)
- Restart computer
- Download latest SSMS manually from: https://learn.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms
- Run installer as Administrator (right-click -> Run as Administrator)
Mistake 4: "Cannot connect to server" -- Wrong server name in SSMS
Wrong: Try to connect with server name = "SQLSERVER" or "MyComputer" or IP address
Result:
Timeout expired. The timeout period elapsed...
Login failed for user 'domain\username'
Fix: Use correct server name: (local) or localhost or . (single dot)
Connect to Server dialog:
Server name: (local) <- Use THIS
Authentication: Windows Authentication
Click: Connect
Common Questions About Installation
Q: Do I need a product key? No. Developer Edition is completely free for development.
Q: Can I run SQL Server and SSMS on same computer? Yes. Most developers do this locally.
Q: Is there a cloud option? Yes. Azure SQL Database is free tier available. But local SQL Server is better for learning.
Q: Do I need admin rights to install? Yes. Run installer as administrator.
Setup for School Management System
Now that you have SQL Server + SSMS ready:
Next article -> Create Student table
CREATE TABLE Student (...)
Article after -> Insert student records
INSERT INTO Student VALUES (...)
Series progresses -> Build 12 SMS tables
Query them with SELECT
Update with UPDATE
Delete with DELETE
Best Practices
- Use Developer Edition -- Full features, free, perfect for learning
- Use Windows Authentication -- Simpler for learning
- Backup your SchoolManagement database -- After adding data
- Update SSMS regularly -- New features, bug fixes
- Use meaningful database names --
SchoolManagement, notDB1
SQL Server = The database engine (stores data on hard drive) SSMS = The tool you use to talk to SQL Server (visual interface)
Analogy:
- SQL Server = A bank vault (the safe)
- SSMS = A teller window (how you interact with vault)
You use SSMS to write SQL commands that tell SQL Server what to do.
Yes, SQL Server is free for learning:
- Developer Edition = Free forever (for development/learning)
- Express Edition = Free with limitations (database size max 10GB)
- Standard Edition = Paid (for production)
- Enterprise Edition = Paid (for large production systems)
For learning: Use Developer Edition. It's completely free and has all features.
In production: Companies buy licenses. But as a learner, Developer Edition is perfect.
Yes, but requires Docker or Azure SQL:
Option 1: Docker (Recommended for Mac/Linux)
docker pull mcr.microsoft.com/mssql/server
docker run -e 'ACCEPT_EULA=Y' -p 1433:1433 mcr.microsoft.com/mssql/server
Then connect from SSMS on Mac via container IP.
Option 2: Azure SQL Database (Cloud)
- Create free tier account at portal.azure.com
- Create Azure SQL Database
- Connect from SSMS
Option 3: Virtual Machine
- Run Windows VM on Mac/Linux
- Install SQL Server traditionally
Easiest: Docker on Mac/Linux. Traditional install on Windows.
Common reasons & fixes:
-
SQL Server not running:
- Go to Services (Windows)
- Search for "SQL Server (MSSQLSERVER)"
- Right-click -> Start
-
Wrong server name:
- Use:
(local)orlocalhostor.(dot) - NOT: machine name or IP address (unless remote)
- Use:
-
Authentication mismatch:
- Install used "SQL Authentication"?
- Try: SQL Server and Windows Authentication in SSMS
-
Firewall blocking:
- Add SSMS to Windows Firewall exceptions
- Or temporarily disable firewall (dev only)
-
Port 1433 in use:
- SQL Server uses port 1433
- Check if another app uses same port
- Change in SQL Server Configuration Manager
For learning: Install locally (on your laptop)
| Aspect | Local | Cloud (Azure) |
|---|---|---|
| Cost | Free | Free tier, then paid |
| Speed | Instant, no latency | 100ms+ latency |
| Learning | Best -- hands-on | Good -- real-world practice |
| Internet | Need for setup only | Need always (no offline) |
Recommendation: Start local. Once you land a job, you'll use cloud databases.
Safe troubleshooting steps:
-
Uninstall cleanly:
- Control Panel -> Uninstall Programs
- Uninstall "SQL Server 2022"
- Uninstall "SSMS"
- Restart computer
-
Clear temp files:
- Windows: Delete
C:\Windows\Temp\* - Restart
- Windows: Delete
-
Download fresh installers:
- Delete old SQL Server installer
- Download latest from Microsoft again
- Run as administrator
-
Try SQL Server Express first:
- If Developer Edition fails, try Express
- Express is smaller, faster install
- Same features for learning
-
Use Docker instead:
- If traditional installation keeps failing
- Docker approach is more reliable
Still stuck? Visit Microsoft SQL Server Community forums. Huge community to help.
Use ChatGPT, Claude, or Copilot to go deeper on SQL Server and SSMS installation setup. Try these prompts:
"Walk me through SQL Server installation step-by-step like I've never done it before""What is the difference between SQL Server Developer Edition, Express, and Standard?""I got 'Cannot connect to server' error. How do I fix it?""Can I run SQL Server and SSMS on Mac or Linux? What are my options?""Quiz me: ask 5 questions about SQL Server installation and SSMS setup"
💡 Tip: After reading this article, paste your own code into AI and ask "What could go wrong here and why?" — fastest way to find edge cases and deepen understanding.