Skip to main content

02. Installing SQL Server & SSMS

Level: Beginner

ℹ️ What You'll Learn
  • 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:

  1. SQL Server -- the database engine (what stores data)
  2. SSMS -- the visual tool (how you write & test queries)

Both are completely free for learning. Let's install them.

What You're Installing

SoftwareWhat It DoesVersion to Install
SQL ServerDatabase engine that stores dataDeveloper Edition 2022 (free)
SSMSVisual tool to write SQL queriesLatest (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

  1. Go to: https://www.microsoft.com/sql-server/sql-server-downloads
  2. Click "Download SQL Server 2022 Developer Edition" (or latest)
  3. Choose "Developer Edition" (not Express)
  4. 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)

  1. Run the installer you downloaded
  2. Choose "Custom" installation
  3. Select features:
    • [OK] Database Engine (required)
    • [OK] Analysis Services (optional)
    • Reporting Services (skip for now)
  4. Instance name: Leave as "MSSQLSERVER" (default)
  5. Authentication:
    • Select "Mixed Mode"
    • Set admin password (remember this!)
  6. 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.

  1. Go to: https://learn.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms
  2. Click "Download SSMS" (latest version)
  3. Run the installer
  4. Click "Install" (use default settings)
  5. 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

  1. Open SSMS (search in Start menu)
  2. You'll see "Connect to Server" dialog:
    • Server name: (local) or localhost or .
    • Authentication: Windows Authentication (default)
  3. 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:

  1. New Database
  2. Database name: SchoolManagement
  3. 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

ProblemSolution
"Cannot connect to server"Restart SQL Server: Control Panel -> Services -> SQL Server
"Login failed for user"Check admin password set during installation
SSMS installation hangsDownload 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:

  1. Kill installer (Task Manager)
  2. Uninstall SSMS completely (Control Panel -> Programs)
  3. Restart computer
  4. Download latest SSMS manually from: https://learn.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms
  5. 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

  1. Use Developer Edition -- Full features, free, perfect for learning
  2. Use Windows Authentication -- Simpler for learning
  3. Backup your SchoolManagement database -- After adding data
  4. Update SSMS regularly -- New features, bug fixes
  5. Use meaningful database names -- SchoolManagement, not DB1

🎯 Q1: SQL Server vs SSMS -- what's the difference?

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.

🎯 Q2: Is SQL Server free? Do I need a license?

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.

🎯 Q3: Can I use SQL Server on Mac or Linux?

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.

🎯 Q4: What if I get 'Cannot connect to server' error?

Common reasons & fixes:

  1. SQL Server not running:

    • Go to Services (Windows)
    • Search for "SQL Server (MSSQLSERVER)"
    • Right-click -> Start
  2. Wrong server name:

    • Use: (local) or localhost or . (dot)
    • NOT: machine name or IP address (unless remote)
  3. Authentication mismatch:

    • Install used "SQL Authentication"?
    • Try: SQL Server and Windows Authentication in SSMS
  4. Firewall blocking:

    • Add SSMS to Windows Firewall exceptions
    • Or temporarily disable firewall (dev only)
  5. Port 1433 in use:

    • SQL Server uses port 1433
    • Check if another app uses same port
    • Change in SQL Server Configuration Manager
🎯 Q5: Should I install SQL Server on my laptop or use cloud (Azure)?

For learning: Install locally (on your laptop)

AspectLocalCloud (Azure)
CostFreeFree tier, then paid
SpeedInstant, no latency100ms+ latency
LearningBest -- hands-onGood -- real-world practice
InternetNeed for setup onlyNeed always (no offline)

Recommendation: Start local. Once you land a job, you'll use cloud databases.

🎯 Q6: What if installation fails or hangs?

Safe troubleshooting steps:

  1. Uninstall cleanly:

    • Control Panel -> Uninstall Programs
    • Uninstall "SQL Server 2022"
    • Uninstall "SSMS"
    • Restart computer
  2. Clear temp files:

    • Windows: Delete C:\Windows\Temp\*
    • Restart
  3. Download fresh installers:

    • Delete old SQL Server installer
    • Download latest from Microsoft again
    • Run as administrator
  4. Try SQL Server Express first:

    • If Developer Edition fails, try Express
    • Express is smaller, faster install
    • Same features for learning
  5. 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 AI to Learn Faster
⚠️ Important for beginners: Do NOT use AI to write your code yet. Type every example yourself. Your brain learns by doing, not by reading AI output. Use AI only to explain and quiz you — not to code for you. Once you have strong fundamentals, AI becomes a powerful productivity tool for repetitive tasks.

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.

Next Article

03. Creating Your First Database & Tables ->

nexcoding.in