Microsoft SQL Server is one of the mainstream database engines that is used daily for workloads ranging from single user application to application platforms that support entire enterprises.

When it comes to acquiring and using SQL Server, one must be cognisant of the various editions that are available.

These are as follows:

Edition Description
Express Free, entry level database
Web Low cost edtiion primary for web hosting scenarios
Standard Edition with standard funcitonality to support small enterprise as a database management system and business intelligece platform
Enterprise Premium edition with all the bells and whistles, including virtualization
Developer This is the same as the enterpise version, but only licensed for development use.

As a developer, you would naturally develop using the Developer edition, which is available both as an installable package and as a docker container. You can get various images of SQL Server here.

As usual, I cannot stress enough how convenient it is to have infrastructure such as a database engine availed as a docker container for development use.

A typical docker-compose.yaml that persists data would look like this:

services:
  sql_server:
    image: mcr.microsoft.com/mssql/server:2022-latest
    container_name: sql_server_2022
    restart: always
    environment:
      - ACCEPT_EULA=Y
      - SA_PASSWORD=YourStrongPassword123
      - TZ=Africa/Nairobi
    ports:
      - '1433:1433'
    volumes:
      - /Users/rad/Data/SQLServer2022:/var/opt/mssql/data

A couple of things of note:

  • restart: always - the image will always restart, including after restarting the docker service unless you manually stop it.
  • ACCEPT_EULA=Y - accept the license agreement
  • SA_PASSWORD - the password for the system administrator
  • TZ=Africa/Nairobi - the time zone the database server will use
  • /Users/rad/Data/SQLServer2022:/var/opt/mssql/data map the data folder in the image, /var/opt/mssql/data, to a location in the host file system, in this case /Users/rad/Data/SQLServer2022

GOTCHA

Given that the developer edition is the same as the enterprise edition feature-wise, it is very easy to use features that are not available in the production environment that you are deploying to.

This means that it is possible to run into application failures, or reduced performance when deploying your application.

Ensure you test against the edition of the database you are deploying to.

A simple solution for this is to grab an evaluation version from here to test against.

TLDR

Microsoft SQL Server is available in various editions. Pick the one best suited for your requirements.

Happy hacking!