HowtoInstallMicrosoftSQLServer2022DeveloperEdition:UsingPowershellandChocolatey
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!
Practical SQL Server Automation
Learn how to build safe, repeatable Ansible and PowerShell automation in isolated sandboxes before touching production.
Free, lab-tested SQL Server automation guides by Luke Campbell, a 20-year production DBA. Unsubscribe anytime.
