Tag: SSMS

  • SQL Server Express vs Docker vs Developer Edition: Which Install Should You Use?

    SQL Server Express vs Docker vs Developer Edition: Which Install Should You Use?

    Before writing a single query, you need SQL Server actually running somewhere. Here’s how to pick without overthinking it — plus enough detail on each option that you’re not just following steps blindly, and know how to troubleshoot when something doesn’t come up cleanly.

    Picking Your Install(there’s no wrong answer here)Your Setup?OS + how often you’ll reset itWindows, want everythingany OS, experimenting a lotWindows, keep it lightDeveloper EditionWindows · every feature, free for devDockerAny OS · instant reset, one commandExpressWindows · lightweight, prod-OK under 10GBDocker container exitsimmediately? Check yourSA password meets thecomplexity rules.

    Option A: SQL Server Developer Edition (Windows, full-featured, free)

    1. Download SQL Server 2022 Developer Edition from Microsoft’s site
    2. Run the installer, choose Basic installation type
    3. Note the instance name at the end — usually localhostSQLEXPRESS or (local)
    4. Install SSMS separately — recent SQL Server installers no longer bundle it

    Developer Edition has every Enterprise Edition feature — In-Memory OLTP, Always Encrypted, columnstore indexes, the works — licensed for free non-production use. Genuinely the best choice if you’re on Windows and want zero feature limitations while learning, including features covered later in the Performance Tuning course that Express doesn’t support at all.

    Option B: Docker (Mac, Linux, or Windows — fastest to reset)

    docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=YourStrong!Passw0rd" 
      -p 1433:1433 --name sql1 --hostname sql1 
      -v sql1data:/var/opt/mssql 
      -d mcr.microsoft.com/mssql/server:2022-latest

    One command, running in under a minute. Breaking down what each flag does:

    Flag What it does
    -e ACCEPT_EULA=Y Required — the container refuses to start without accepting Microsoft’s license terms
    -e MSSQL_SA_PASSWORD=... Sets the sa login’s password — must meet complexity rules (8+ chars, mixed case, a digit, a symbol) or the container silently fails to start
    -p 1433:1433 Maps container port 1433 to your machine’s port 1433, so SSMS on your host can reach it at localhost,1433
    -v sql1data:/var/opt/mssql Persists your data in a named Docker volume — without this, deleting the container also deletes every database inside it

    Useful follow-up commands once it’s running:

    docker ps                         # confirm the container is actually running
    docker logs sql1                  # see startup errors if the connection fails
    docker exec -it sql1 bash         # get a shell inside the container
    docker rm -f sql1                 # completely remove it (data survives if you used -v)

    The real advantage of Docker: a clean-slate reset is one command, with no uninstall wizard and no leftover registry entries — genuinely useful if you want to practice an install/setup scenario repeatedly, or if you’re on macOS/Linux where the native installer isn’t an option.

    Comparing Your Options

    Developer Ed. Windows only Full feature set SSMS built for it Docker Any OS Instant reset Best for experimenting Express Windows only 10GB DB size cap Lightweight install

    Express is genuinely fine for more than “just learning” — plenty of small production applications with modest data volumes run on it for free indefinitely, as long as you stay under the 10GB-per-database cap and 1GB RAM buffer pool limit. If you outgrow it, upgrading in place to Standard or Enterprise is a licensing change, not a data migration — your databases carry over untouched.

    A Fourth Option: Native Linux Install

    SQL Server also installs directly on Ubuntu, RHEL, and SUSE without Docker — useful if you’re deploying to a Linux server long-term and want to match production exactly, though Docker is faster for local experimentation since you’re not managing a package manager and systemd service directly.

    The Client Tool: SSMS or Azure Data Studio

    Tool Platform Best for
    SSMS (SQL Server Management Studio) Windows only The traditional, full-featured tool — richest GUI for administration tasks (backups, security, job scheduling)
    Azure Data Studio Windows, macOS, Linux Lighter, cross-platform, closer to a VS Code-style editor experience — the natural choice if you’re on Mac/Linux or already comfortable with VS Code

    Either works fine — every query in this course runs identically in both. Pick based on your OS, not a perceived “better” choice.

    Troubleshooting a Failed Install

    Common issue: The Docker container starts then immediately exits. Almost always the SA password didn’t meet complexity requirements — check with docker logs sql1, which will show the exact rejection reason.
    Common issue: Windows installer completes, but SSMS can’t connect to localhost. Try the full instance name shown at the end of setup (often localhostSQLEXPRESS) — a named instance doesn’t respond on plain localhost alone.

    Enjoyed this?

    Subscribe to get every new SQL Server lesson as soon as it’s published, and share it with a developer who’d find it useful.

    📡 Subscribe via RSS  | 
    Share on X  | 
    Share on LinkedIn  | 
    Share on Facebook

    Want the full structured course with quizzes, projects, and 10+ exercises per chapter? Check out SQL Server Fundamentals, coming soon on this site.

  • Your First SQL Server Database: Connect, Create, and Query in 5 Minutes

    Your First SQL Server Database: Connect, Create, and Query in 5 Minutes

    Setup is done. Now let’s actually touch SQL Server — connect, create a database, and prove it works with a real query. We’ll also cover exactly what each authentication option means and the handful of connection errors you’re statistically most likely to hit, so a wrong password doesn’t turn into twenty minutes of confusion.

    Your First 5 Minutes(connect → create → query)1. ConnectSSMS → server name → auth mode2. CREATE DATABASETechCorpLite comes to life3. Prove ItSELECT ‘Connected!’ AS status✓ it’s alivepick one:Windows Authyour OS login, no password to manageSQL Authsa + password — Docker, Linux, cloudGO isn’t T-SQL.It’s a client-side batchseparator — the servernever even sees it.

    Step 1: Connect

    Open SSMS → Connect → enter your server name (e.g. localhost or localhostSQLEXPRESS) → choose an authentication mode.

    Authentication mode How it works When to use it
    Windows Authentication Uses your logged-in Windows account — no separate password to manage Local installs, on-prem corporate networks. The default and generally preferred choice when available
    SQL Server Authentication A username/password stored and checked by SQL Server itself, independent of the OS Docker containers, Linux hosts, cross-platform apps, cloud databases — anywhere there’s no Windows domain to rely on

    For a Docker install, you’ll use SQL Server Authentication with username sa and the password you set in the MSSQL_SA_PASSWORD environment variable when you started the container.

    Step 2: Create Your First Database

    CREATE DATABASE TechCorpLite;
    GO
    
    USE TechCorpLite;
    GO
    
    SELECT 'Connected!' AS status, @@VERSION AS server_version;

    Run it with F5. If you see a result grid with “Connected!” in it, you’re live. TechCorpLite is the database this entire tutorial series builds up, table by table — bookmark this one. By the end of Chapter 7’s capstone project, it’ll have authors, books, customers, and orders tables with real relationships between them.

    What Just Happened, Visually

    SSMS (client) TCP 1433 SQL Server the engine TechCorpLite DB

    SSMS is just a client — it’s not the database itself. It sends your T-SQL over the network (TCP port 1433 by default) to the SQL Server engine, which parses, compiles, and executes it, then creates and manages the actual TechCorpLite database on disk. This client/server split matters later: the exact same T-SQL you type in SSMS is what any application (a web backend, a reporting tool, a Python script) sends over that same connection — SSMS has no special privileges the engine doesn’t also expose to any other client.

    Exploring What You Just Created

    Beyond just running a query, it’s worth seeing how SQL Server itself reports on its own structure — you’ll use these constantly:

    -- List every database on this server
    SELECT name, create_date FROM sys.databases;
    
    -- Confirm which database your current session is using
    SELECT DB_NAME() AS current_database;
    
    -- Standard, cross-vendor way to inspect tables (empty for now — no tables yet)
    SELECT * FROM INFORMATION_SCHEMA.TABLES;

    sys.databases is a SQL-Server-specific system view; INFORMATION_SCHEMA is an ANSI-standard set of views that work similarly across SQL Server, PostgreSQL, and MySQL — useful to know if you ever move between database engines.

    Fixing the Connection Errors You’ll Actually Hit

    Error message What it usually means
    “A network-related or instance-specific error…” Wrong server name, or the SQL Server service isn’t running — check Services (Windows) or docker ps (Docker)
    “Login failed for user ‘sa’” Wrong password, or SQL Server Authentication mode isn’t enabled on the instance (Windows installs default to Windows-only auth)
    “Cannot open database … requested by the login” Database name typo, or your login lacks permission on that specific database
    Connects, but every query times out Almost always a firewall blocking port 1433 — common on cloud VMs and corporate networks
    Practice tip: Deliberately mistype your server name once and read the full error text SQL Server gives you. You’ll see a version of this error again eventually in real work — recognizing it on sight beats re-googling it every time.

    Key Takeaways

    • SQL Server is the engine; SSMS/Azure Data Studio is just a client that talks to it over the network
    • CREATE DATABASE makes a new, empty database; USE switches your session’s default context into it — without USE, unqualified table names resolve against the wrong database
    • GO is a batch separator understood by SSMS/sqlcmd — it’s not T-SQL itself, and the server never sees it; it just tells the client tool where one batch of statements ends and the next begins
    • Windows Authentication uses your OS login; SQL Server Authentication is a separate username/password the engine manages itself — you’ll need the latter for Docker, Linux, and most cloud setups

    Enjoyed this?

    Subscribe to get every new SQL Server lesson as soon as it’s published, and share it with a developer who’d find it useful.

    📡 Subscribe via RSS  | 
    Share on X  | 
    Share on LinkedIn  | 
    Share on Facebook

    Want the full structured course with quizzes, projects, and 10+ exercises per chapter? Check out SQL Server Fundamentals, coming soon on this site.