How to Install Microsoft SQL Server 2022 Developer Edition: Using Powershell and Chocolatey
Nov 20, 2023
Have you ever needed to install a relational database engine fast in your sandbox? SQL Server is well known for its easy installation, albeit not all best practices are configured as part of the general installation. In this video, I will show you how to install SQL Server 2022 Developer Edition fast using a Chocolatey and a few lines of Powershell.
Here's what you will have accomplished by the end;
- Install Chocolatey.
- Install SQL Server 2022 Developer Edition.
- Install the latest update for SQL Server 2022.
- Enable the TCP\IP protocol so that the instance is accessible within your sandbox from remote servers using SQL Server Configuration Manager.
- Install SQL Server Management Studio and Azure Data Explorer.
- Download the WideWorldImportersDW sample database backup file.
- Restore the WideWorldImportersDW database.
- Run a select query to ensure the database is accessible.
I'm installing it on a Windows Server 2022 Standard Edition evaluation copy. However, you can perform the same steps on Windows 11.
Powershell statements used in the video;
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))choco install sql-server-2022 -ystart-process https://download.microsoft.com/download/9/6/8/96819b0c-c8fb-4b44-91b5-c97015bbda9f/SQLServer2022-KB5031778-x64.exechoco install sql-server-management-studio -ystart-process https://aka.ms/wwidw_mgf #download WideWorldImportersDWnew-item -path "c:\sql_sample_databases\" -itemType "Directory"
T-SQL used in the video to restore WideWorldImportersDW and then verify data is available by using a Select statement:
RESTORE DATABASE WideWorldImportersDWFROM DISK = 'c:\sql_sample_databases\wwidw_mgf.bak'WITH STATS = 10USE WideWorldImportersDWgoSELECT * FROM Fact.Movement
Thanks for stopping by!
LinkedIn YouTube Newsletter
Related Automation Guides
Why Ansible When I Have dbatools and PowerShell?
You don’t need to throw away 10 years of rock-solid PowerShell to get declarative scale.
What is Inline Vault Encryption? A Guide to Using ansible-vault encrypt_string
Stop encrypting entire YAML files. Learn to use ansible-vault encrypt_string to protect individual passwords while keeping your config readable for collaboration.
What is an Ansible Vault File? How to Create and Use Your First Encrypted Variables
Take the first step to secure automation. Learn to create an encrypted Ansible Vault file to manage SQL Server passwords, protect secrets, and pass your next audit.

The Database Platform Automation Roadmap
Move from checklists and scattered scripts to desired-state Ansible playbooks—so you can stop wondering whether production still matches what you built. Includes the 60-second self-audit and 23-page field guide (PDF).
