SQL Server · Fundamentals

SQL Server Installation

You need a SQL Server instance to practise on. The free Developer edition has every feature, and Docker lets you run it on Windows, macOS or Linux in one command.

Beginner 5 min Lesson 2 of 31Examples run on SQL Server 2022 and Azure SQL Database.
0/31 in SQL Server
On this page · 5 min · Beginner

In simple words#

Installing SQL Server is like setting up the school office building; SSMS or Azure Data Studio is the desk and pen you use to work inside it.

SQL Server
The database engine that stores data.
SSMS
SQL Server Management Studio — a tool to run queries.
Instance
One installed copy, e.g. localhost or .\SQLEXPRESS.

Learning objectives#

  • Choose the right SQL Server edition
  • Run SQL Server in Docker
  • Connect with SSMS or the VS Code mssql extension
  • Verify the installation with a query

Explanation#

SQL Server comes in several editions. Developer is free and full-featured but licensed for development and testing only. Express is free for production with size and resource limits. Standard and Enterprise are paid.

On Windows you can run the installer and choose “Developer”. On any OS with Docker, the official image starts a server in seconds.

To write queries you need a client: SQL Server Management Studio (SSMS, Windows) or Visual Studio Code with the mssql extension (all platforms).

Code example: SQL Server 2022 in Docker#

ShellSQL Server 2022 in Docker Illustrative
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=Str0ng!Passw0rd" \
  -p 1433:1433 --name sql2022 -d mcr.microsoft.com/mssql/server:2022-latest


# Connect from SSMS or VS Code: server = localhost,1433  user = sa
# Then run:  SELECT @@VERSION;
Expected output
Microsoft SQL Server 2022 (RTM-CU…) - 16.0.… (X64) … Developer Edition (64-bit) on Linux …

This example is illustrative. Copy or download it and run it in your own environment; the expected output is shown above.

Step-by-step explanation#

  1. ACCEPT_EULA=Y accepts the licence terms.
  2. MSSQL_SA_PASSWORD sets the system administrator password; it must be strong or the container will exit.
  3. -p 1433:1433 exposes the default SQL Server port.
  4. SELECT @@VERSION confirms which version and edition you are connected to.

Real-world use case#

Teams use the Docker image so every developer and every CI pipeline runs exactly the same SQL Server version.

Common mistakes#

Weak sa password

If the password does not meet complexity rules, the container starts and immediately stops. Check docker logs sql2022.

Using sa in applications

sa is all-powerful. Create a dedicated login with only the permissions your app needs.

Best practices#

  • Use Developer edition for learning and development
  • Keep data in a Docker volume so it survives container removal
  • Create least-privilege logins for applications
  • Never expose port 1433 to the internet

Remember this#

Developer edition = free for learning; Express = free for small production.

SSMS or Azure Data Studio is where you write queries.

Server name: localhost or .\SQLEXPRESS.

Practice exercise#

Your task: Start the container, connect, and create a database called Practice.

Show solution
SQL Illustrative
CREATE DATABASE Practice;
GO
SELECT name FROM sys.databases;

Mini quiz#

SQL Server Installation quizMultiple choice Question 1 of 2

Which edition is free and full-featured but only for development and testing?

Score so far: 0/0

Want more? Practise all SQL Server MCQs · SQL Server interview questions

My notes#

Saved in this browser.

Progress is saved in this browser. Sign in to sync.