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.
On this page · 5 min · Beginner
On this page
- In simple words
- Learning objectives
- Explanation
- Code example
- Step by step
- Real-world use
- Common mistakes
- Best practices
- Remember this
- Practice exercise
- Mini quiz
- Related topics
- My notes
- Reading time
- 5 min
- Difficulty
- Beginner
- Updated
- Oct 27, 2026
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#
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;
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#
- ACCEPT_EULA=Y accepts the licence terms.
- MSSQL_SA_PASSWORD sets the system administrator password; it must be strong or the container will exit.
- -p 1433:1433 exposes the default SQL Server port.
- 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#
If the password does not meet complexity rules, the container starts and immediately stops. Check docker logs sql2022.
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
CREATE DATABASE Practice;
GO
SELECT name FROM sys.databases;
Mini quiz#
Which edition is free and full-featured but only for development and testing?
Want more? Practise all SQL Server MCQs · SQL Server interview questions
My notes#
Saved in this browser.