Microsoft SQL Server 2022 LocalDB Silent Install (How-To Guide)

Microsoft SQL Server 2022 LocalDB is a developer oriented, on-demand managed instance of the SQL Server engine that can be turned on automatically when needed and turned off when not in use. This article will serve as an informative guide and give you a clear understanding of how to perform a silent installation of Microsoft SQL Server 2022 LocalDB from the command line using the MSI installer.

How to Install Microsoft SQL Server 2022 LocalDB Silently

Microsoft SQL Server 2022 LocalDB Silent Install (MSI)

  1. Navigate to: https://www.microsoft.com/en-us/download/confirmation.aspx?id=104781
  2. Download & Copy the SQL2022-SSEI-Expr.exe to a folder created at (C:\Downloads)
  3. Open an Elevated Command Prompt by Right-Clicking on Command Prompt and select Run as Administrator
  4. Navigate to the C:\Downloads folder
  5. Enter the following command to extract the SqlLocalDB.msi:
    • SQL2022-SSEI-Expr.exe /ACTION=Download MEDIAPATH=C:\Downloads /MEDIATYPE=LocalDB /QUIET
  6. Press Enter
  7. Navigate to the C:\Downloads\en-US folder
  8. Enter the following command:
    • MsiExec.exe /i SqlLocalDB.msi IACCEPTSQLLOCALDBLICENSETERMS=YES /qn
  9. Press Enter

After a few moments you should see the Microsoft SQL Server 2022 LocalDB entries in the Installation Directory and Programs and Features in the Control Panel.

Software Title:Microsoft SQL Server 2022 LocalDB
Vendor:Microsoft Corporation
Version:16.0.1000.6
Architecture:x64
Installer Type:MSI
Silent Install Switch:MsiExec.exe /i SqlLocalDB.msi IACCEPTSQLLOCALDBLICENSETERMS=YES /qn
Silent Uninstall Switch:MsiExec.exe /x {83A54FE1-423D-4DE8-BD80-85593BA94752} /qn
Download Link:https://www.microsoft.com/en-us/download/confirmation.aspx?id=104781
PowerShell Script:https://silentinstallhq.com/microsoft-sql-server-2022-localdb-install-and-uninstall-powershell/
Detection Script:https://silentinstallhq.com/create-a-custom-detection-script-for-microsoft-sql-server-2022-localdb-powershell/

The information above provides a quick overview of the software title, vendor, silent install, and silent uninstall switches. The download links provided take you directly to the vendors website. Continue reading if you are interested in additional details and configurations.


Additional Configurations

Create a Microsoft SQL Server 2022 LocalDB Installation Log File

The Microsoft SQL Server 2022 LocalDB installer offers the option to generate a log file during installation to assist with troubleshooting should any problems arise. You can use the following commands to create a verbose log file with details about the installation.

Microsoft SQL Server 2022 LocalDB Silent Install with Logging (MSI)

MsiExec.exe /i SqlLocalDB.msi IACCEPTSQLLOCALDBLICENSETERMS=YES /qn /L*v "%WINDIR%\Temp\SqlLocalDB-Install.log"

How to Uninstall Microsoft SQL Server 2022 LocalDB Silently

Check out the following post for a scripted solution:

Microsoft SQL Server 2022 LocalDB Install and Uninstall (PowerShell)
Microsoft SQL Server 2022 LocalDB Silent Uninstall (PowerShell)
  1. Open an Elevated Command Prompt by Right-Clicking on Command Prompt and select Run as Administrator
  2. Enter the following command:

Microsoft SQL Server 2022 LocalDB Silent Uninstall (MSI)

MsiExec.exe /x {83A54FE1-423D-4DE8-BD80-85593BA94752} /qn

Always make sure to test everything in a development environment prior to implementing anything into production. The information in this article is provided “As Is” without warranty of any kind.