Microsoft SQL Server 2022 Express is a powerful and reliable free data management system that delivers a rich and reliable data store for lightweight Web Sites and desktop applications. 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 Express from the command line using the EXE installer.
How to Install Microsoft SQL Server 2022 Express Silently
Microsoft SQL Server 2022 Express (SQLEXPR) Silent Install (EXE)
- Navigate to: https://www.microsoft.com/en-us/download/confirmation.aspx?id=104781
- Download & Copy the SQL2022-SSEI-Expr.exe to a folder created at (C:\Downloads)
- Open an Elevated Command Prompt by Right-Clicking on Command Prompt and select Run as Administrator
- Navigate to the C:\Downloads folder
- Enter the following command to extract the SQLEXPR_x64_ENU.exe:
SQL2022-SSEI-Expr.exe /ACTION=Download MEDIAPATH=C:\Downloads /MEDIATYPE=Core /QUIET
- Press Enter
- Enter the following command to extract the setup installation files:
SQLEXPR_x64_ENU.exe /q /x:C:\Downloads\SQLEXPR_2022
- Press Enter
- Navigate to the C:\Downloads\SQLEXPR_2022 folder
- Enter the following command to generate a configuration file:
SETUP.EXE /UIMODE=Normal /ACTION=INSTALL
- Press Enter
- Follow the installation wizard through to the Ready to Install page.
- The path to the configuration file is specified in the Ready to Install page in the “configuration file path” section.
- Copy the ConfigurationFile.ini referenced in the configuration file path to C:\Downloads\SQLEXPR_2022
- Cancel the setup wizard without actually completing the installation
- Open the ConfigurationFile.ini and modify/add the following options:
- Change QUIET=”False” to QUIET=”True”
- Change UIMODE=”Normal” to ;UIMODE=”Normal”
- Change UpdateEnabled=”True” to UpdateEnabled=”False”
- Add the following line:
- IACCEPTSQLSERVERLICENSETERMS=”True”
- Save the changes to the ConfigurationFile.ini file
Example SQL Server 2022 Configuration File
;SQL Server 2022 Configuration File
[OPTIONS]
; Specifies a Setup work flow, like INSTALL, UNINSTALL, or UPGRADE. This is a required parameter.
ACTION="Install"
; Use the /ENU parameter to install the English version of SQL Server on your localized Windows operating system.
ENU="True"
; Setup roles install SQL Server in a predetermined configuration.
ROLE="AllFeatures_WithDefaults"
; Indicates whether the supplied product key is covered by Service Assurance.
PRODUCTCOVEREDBYSA="False"
; Specifies that SQL Server Setup should not display the privacy statement when ran from the command line.
SUPPRESSPRIVACYSTATEMENTNOTICE="True"
; Setup will not display any user interface.
QUIET="True"
; Setup will display progress only, without any user interaction.
QUIETSIMPLE="False"
; Parameter that controls the user interface behavior. Valid values are Normal for the full UI,AutoAdvance for a simplied UI, and EnableUIOnServerCore for bypassing Server Core setup GUI block.
; UIMODE="Normal"
; Specify whether SQL Server Setup should discover and include product updates. The valid values are True and False or 1 and 0. By default SQL Server Setup will include updates that are found.
UpdateEnabled="False"
; If this parameter is provided, then this computer will use Microsoft Update to check for updates.
USEMICROSOFTUPDATE="False"
; Specifies that SQL Server Setup should not display the paid edition notice when ran from the command line.
SUPPRESSPAIDEDITIONNOTICE="True"
; Specify the location where SQL Server Setup will obtain product updates. The valid values are "MU" to search Microsoft Update, a valid folder path, a relative path such as .\MyUpdates or a UNC share. By default SQL Server Setup will search Microsoft Update or a Windows Update service through the Window Server Update Services.
UpdateSource="MU"
; Specifies features to install, uninstall, or upgrade. The list of top-level features include SQL, AS, IS, MDS, and Tools. The SQL feature will install the Database Engine, Replication, Full-Text, and Data Quality Services (DQS) server. The Tools feature will install shared components.
FEATURES=SQLENGINE,REPLICATION
; Displays the command line parameters usage.
HELP="False"
; Specifies that the detailed Setup log should be piped to the console.
INDICATEPROGRESS="False"
; Specify a default or named instance. MSSQLSERVER is the default instance for non-Express editions and SQLExpress for Express editions. This parameter is required when installing the SQL Server Database Engine (SQL), or Analysis Services (AS).
INSTANCENAME="SQLEXPRESS"
; Specify the root installation directory for shared components. This directory remains unchanged after shared components are already installed.
INSTALLSHAREDDIR="C:\Program Files\Microsoft SQL Server"
; Specify the root installation directory for the WOW64 shared components. This directory remains unchanged after WOW64 shared components are already installed.
INSTALLSHAREDWOWDIR="C:\Program Files (x86)\Microsoft SQL Server"
; Specify the Instance ID for the SQL Server features you have specified. SQL Server directory structure, registry structure, and service names will incorporate the instance ID of the SQL Server instance.
INSTANCEID="SQLEXPRESS"
; Startup type for the SQL Server CEIP service.
SQLTELSVCSTARTUPTYPE="Disabled"
; Account for SQL Server CEIP service: Domain\User or system account.
SQLTELSVCACCT="NT Service\SQLTELEMETRY$SQLEXPRESS"
; Specify the installation directory.
INSTANCEDIR="C:\Program Files\Microsoft SQL Server"
; Agent account name.
AGTSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE"
; Auto-start service after installation.
AGTSVCSTARTUPTYPE="Disabled"
; Startup type for the SQL Server service.
SQLSVCSTARTUPTYPE="Automatic"
; Level to enable FILESTREAM feature at (0, 1, 2 or 3).
FILESTREAMLEVEL="0"
; The max degree of parallelism (MAXDOP) server configuration option.
SQLMAXDOP="0"
; Set to "1" to enable RANU for SQL Server Express.
ENABLERANU="True"
; Specifies a Windows collation or an SQL collation to use for the Database Engine.
SQLCOLLATION="SQL_Latin1_General_CP1_CI_AS"
; Account for SQL Server service: Domain\User or system account.
SQLSVCACCOUNT="NT Service\MSSQL$SQLEXPRESS"
; Set to "True" to enable instant file initialization for SQL Server service. If enabled, Setup will grant Perform Volume Maintenance Task privilege to the Database Engine Service SID. This may lead to information disclosure as it could allow deleted content to be accessed by an unauthorized principal.
SQLSVCINSTANTFILEINIT="False"
; Windows account(s) to provision as SQL Server system administrators.
SQLSYSADMINACCOUNTS="BUILTIN\Administrators"
; The number of Database Engine TempDB files.
SQLTEMPDBFILECOUNT="1"
; Specifies the initial size of a Database Engine TempDB data file in MB.
SQLTEMPDBFILESIZE="8"
; Specifies the automatic growth increment of each Database Engine TempDB data file in MB.
SQLTEMPDBFILEGROWTH="64"
; Specifies the initial size of the Database Engine TempDB log file in MB.
SQLTEMPDBLOGFILESIZE="8"
; Specifies the automatic growth increment of the Database Engine TempDB log file in MB.
SQLTEMPDBLOGFILEGROWTH="64"
; Provision current user as a Database Engine system administrator for SQL Server 2022 Express.
ADDCURRENTUSERASSQLADMIN="True"
; Specify 0 to disable or 1 to enable the TCP/IP protocol.
TCPENABLED="1"
; Specify 0 to disable or 1 to enable the Named Pipes protocol.
NPENABLED="1"
; Startup type for Browser Service.
BROWSERSVCSTARTUPTYPE="Disabled"
; Use SQLMAXMEMORY to minimize the risk of the OS experiencing detrimental memory pressure.
SQLMAXMEMORY="2147483647"
; Use SQLMINMEMORY to reserve a minimum amount of memory available to the SQL Server Memory Manager.
SQLMINMEMORY="0"
; Accept the SQL Server License Terms
IACCEPTSQLSERVERLICENSETERMS="True"
To specify passwords at the command prompt instead of in the configuration file you can use the following format:
SETUP.EXE /SQLSVCPASSWORD="************" /AGTSVCPASSWORD="************" /ASSVCPASSWORD="************" /ISSVCPASSWORD="************" /RSSVCPASSWORD="************" /ConfigurationFile=ConfigurationFile.ini |
- Enter the following command to install SQL Server 2022 Express:
SETUP.EXE /ConfigurationFile=ConfigurationFile.ini |
After a few minutes you should see the Microsoft SQL Server 2022 Express entries in the Start Menu, Installation Directory, and Programs and Features in the Control Panel.
Software Title: | SQL Server 2022 Express |
Vendor: | Microsoft Corporation |
Architecture: | x64 |
Installer Type: | EXE |
Silent Install Switch: | SETUP.EXE /ConfigurationFile=ConfigurationFile.ini |
Silent Uninstall Switch: | SETUP.EXE /ConfigurationFile=ConfigurationFile_Uninstall.ini |
Download Link: | https://www.microsoft.com/en-us/download/confirmation.aspx?id=104781 |
PowerShell Script: | https://silentinstallhq.com/microsoft-sql-server-2022-express-install-and-uninstall-powershell/ |
Detection Script: | https://silentinstallhq.com/create-a-custom-detection-script-for-microsoft-sql-server-2022-express-powershell/ |
Microsoft SQL Server 2022 Express with Advanced Services (SQLEXPRADV) Silent Install (EXE)
- Navigate to: https://www.microsoft.com/en-us/download/confirmation.aspx?id=104781
- Download & Copy the SQL2022-SSEI-Expr.exe to a folder created at (C:\Downloads)
- Open an Elevated Command Prompt by Right-Clicking on Command Prompt and select Run as Administrator
- Navigate to the C:\Downloads folder
- Enter the following command to extract the SQLEXPRADV_x64_ENU.exe:
SQL2022-SSEI-Expr.exe /ACTION=Download MEDIAPATH=C:\Downloads /MEDIATYPE=Advanced /QUIET
- Press Enter
- Enter the following command to extract the setup installation files:
SQLEXPRADV_x64_ENU.exe /q /x:C:\Downloads\SQLEXPRADV_2022
- Press Enter
- Navigate to the C:\Downloads\SQLEXPRADV_2022 folder
- Enter the following command to generate a configuration file:
SETUP.EXE /UIMODE=Normal /ACTION=INSTALL
- Press Enter
- Follow the installation wizard through to the Ready to Install page.
- The path to the configuration file is specified in the Ready to Install page in the “configuration file path” section.
- Copy the ConfigurationFile.ini referenced in the configuration file path to C:\Downloads\SQLEXPRADV_2022
- Cancel the setup wizard without actually completing the installation
- Open the ConfigurationFile.ini and modify/add the following options:
- Change QUIET=”False” to QUIET=”True”
- Change UIMODE=”Normal” to ;UIMODE=”Normal”
- Change UpdateEnabled=”True” to UpdateEnabled=”False”
- Add the following line:
- IACCEPTSQLSERVERLICENSETERMS=”True”
- Save the changes to the ConfigurationFile.ini file
Example SQL Server 2022 Configuration File
;SQL Server 2022 Configuration File
[OPTIONS]
; Specifies a Setup work flow, like INSTALL, UNINSTALL, or UPGRADE. This is a required parameter.
ACTION="Install"
; Use the /ENU parameter to install the English version of SQL Server on your localized Windows operating system.
ENU="True"
; Setup roles install SQL Server in a predetermined configuration.
ROLE="AllFeatures_WithDefaults"
; Indicates whether the supplied product key is covered by Service Assurance.
PRODUCTCOVEREDBYSA="False"
; Specifies that SQL Server Setup should not display the privacy statement when ran from the command line.
SUPPRESSPRIVACYSTATEMENTNOTICE="True"
; Setup will not display any user interface.
QUIET="True"
; Setup will display progress only, without any user interaction.
QUIETSIMPLE="False"
; Parameter that controls the user interface behavior. Valid values are Normal for the full UI,AutoAdvance for a simplied UI, and EnableUIOnServerCore for bypassing Server Core setup GUI block.
; UIMODE="Normal"
; Specify whether SQL Server Setup should discover and include product updates. The valid values are True and False or 1 and 0. By default SQL Server Setup will include updates that are found.
UpdateEnabled="False"
; If this parameter is provided, then this computer will use Microsoft Update to check for updates.
USEMICROSOFTUPDATE="False"
; Specifies that SQL Server Setup should not display the paid edition notice when ran from the command line.
SUPPRESSPAIDEDITIONNOTICE="True"
; Specify the location where SQL Server Setup will obtain product updates. The valid values are "MU" to search Microsoft Update, a valid folder path, a relative path such as .\MyUpdates or a UNC share. By default SQL Server Setup will search Microsoft Update or a Windows Update service through the Window Server Update Services.
UpdateSource="MU"
; Specifies features to install, uninstall, or upgrade. The list of top-level features include SQL, AS, IS, MDS, and Tools. The SQL feature will install the Database Engine, Replication, Full-Text, and Data Quality Services (DQS) server. The Tools feature will install shared components.
FEATURES=SQLENGINE,REPLICATION,ADVANCEDANALYTICS,FULLTEXT,POLYBASECORE,LOCALDB
; Displays the command line parameters usage.
HELP="False"
; Specifies that the detailed Setup log should be piped to the console.
INDICATEPROGRESS="False"
; Specify a default or named instance. MSSQLSERVER is the default instance for non-Express editions and SQLExpress for Express editions. This parameter is required when installing the SQL Server Database Engine (SQL), or Analysis Services (AS).
INSTANCENAME="SQLEXPRESS"
; Specify the root installation directory for shared components. This directory remains unchanged after shared components are already installed.
INSTALLSHAREDDIR="C:\Program Files\Microsoft SQL Server"
; Specify the root installation directory for the WOW64 shared components. This directory remains unchanged after WOW64 shared components are already installed.
INSTALLSHAREDWOWDIR="C:\Program Files (x86)\Microsoft SQL Server"
; Specify the Instance ID for the SQL Server features you have specified. SQL Server directory structure, registry structure, and service names will incorporate the instance ID of the SQL Server instance.
INSTANCEID="SQLEXPRESS"
; Account for SQL Server PolyBase Engine: Domain\User or system account.
PBENGSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE"
; Startup type for the SQL Server PolyBase Engine.
;PBENGSVCSTARTUPTYPE="Automatic"
; Startup type for the SQL Server PolyBase Data Movement Service.
;PBDMSSVCSTARTUPTYPE="Automatic"
; Account for SQL Server PolyBase Data Movement Service: Domain\User or system account.
;PBDMSSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE"
; Port range for PolyBase Services (inclusive).
PBPORTRANGE="16450-16460"
; Startup type for the SQL Server CEIP service.
SQLTELSVCSTARTUPTYPE="Disabled"
; Account for SQL Server CEIP service: Domain\User or system account.
SQLTELSVCACCT="NT Service\SQLTELEMETRY$SQLEXPRESS"
; Specify the installation directory.
INSTANCEDIR="C:\Program Files\Microsoft SQL Server"
; Agent account name.
AGTSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE"
; Auto-start service after installation.
AGTSVCSTARTUPTYPE="Disabled"
; Startup type for the SQL Server service.
SQLSVCSTARTUPTYPE="Automatic"
; Level to enable FILESTREAM feature at (0, 1, 2 or 3).
FILESTREAMLEVEL="0"
; The max degree of parallelism (MAXDOP) server configuration option.
SQLMAXDOP="0"
; Set to "1" to enable RANU for SQL Server Express.
ENABLERANU="True"
; Specifies a Windows collation or an SQL collation to use for the Database Engine.
SQLCOLLATION="SQL_Latin1_General_CP1_CI_AS"
; Account for SQL Server service: Domain\User or system account.
SQLSVCACCOUNT="NT Service\MSSQL$SQLEXPRESS"
; Set to "True" to enable instant file initialization for SQL Server service. If enabled, Setup will grant Perform Volume Maintenance Task privilege to the Database Engine Service SID. This may lead to information disclosure as it could allow deleted content to be accessed by an unauthorized principal.
SQLSVCINSTANTFILEINIT="False"
; Windows account(s) to provision as SQL Server system administrators.
SQLSYSADMINACCOUNTS="BUILTIN\Administrators"
; The number of Database Engine TempDB files.
SQLTEMPDBFILECOUNT="1"
; Specifies the initial size of a Database Engine TempDB data file in MB.
SQLTEMPDBFILESIZE="8"
; Specifies the automatic growth increment of each Database Engine TempDB data file in MB.
SQLTEMPDBFILEGROWTH="64"
; Specifies the initial size of the Database Engine TempDB log file in MB.
SQLTEMPDBLOGFILESIZE="8"
; Specifies the automatic growth increment of the Database Engine TempDB log file in MB.
SQLTEMPDBLOGFILEGROWTH="64"
; Provision current user as a Database Engine system administrator for SQL Server 2022 Express.
ADDCURRENTUSERASSQLADMIN="False"
; Specify 0 to disable or 1 to enable the TCP/IP protocol.
TCPENABLED="1"
; Specify 0 to disable or 1 to enable the Named Pipes protocol.
NPENABLED="1"
; Startup type for Browser Service.
BROWSERSVCSTARTUPTYPE="Disabled"
; User account for Launchpad Service.
EXTSVCACCOUNT="NT Service\MSSQLLaunchpad$SQLEXPRESS"
; User account for Full-text Filter Daemon Host.
FTSVCACCOUNT="NT Service\MSSQLFDLauncher$SQLEXPRESS"
; Use SQLMAXMEMORY to minimize the risk of the OS experiencing detrimental memory pressure.
SQLMAXMEMORY="2147483647"
; Use SQLMINMEMORY to reserve a minimum amount of memory available to the SQL Server Memory Manager.
SQLMINMEMORY="0"
; Accept the SQL Server License Terms
IACCEPTSQLSERVERLICENSETERMS="True"
To specify passwords at the command prompt instead of in the configuration file you can use the following format:
SETUP.EXE /SQLSVCPASSWORD="************" /AGTSVCPASSWORD="************" /ASSVCPASSWORD="************" /ISSVCPASSWORD="************" /RSSVCPASSWORD="************" /ConfigurationFile=ConfigurationFile.ini |
- Enter the following command to install SQL Server 2022 Express:
SETUP.EXE /ConfigurationFile=ConfigurationFile.ini |
After a few minutes you should see the Microsoft SQL Server 2022 Express entries in the Start Menu, Installation Directory, and Programs and Features in the Control Panel.
Software Title: | SQL Server 2022 Express with Advanced Services |
Vendor: | Microsoft Corporation |
Architecture: | x64 |
Installer Type: | EXE |
Silent Install Switch: | SETUP.EXE /ConfigurationFile=ConfigurationFile.ini |
Silent Uninstall Switch: | SETUP.EXE /ConfigurationFile=ConfigurationFile_Uninstall.ini |
Download Link: | https://www.microsoft.com/en-us/download/confirmation.aspx?id=104781 |
PowerShell Script: | https://silentinstallhq.com/microsoft-sql-server-2022-express-install-and-uninstall-powershell/ |
Detection Script: | https://silentinstallhq.com/create-a-custom-detection-script-for-microsoft-sql-server-2022-express-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.
How to Uninstall SQL Server 2022 Express Silently
Check out the following posts for a scripted solution:
Microsoft SQL Server 2022 Express Install and Uninstall (PowerShell) |
Microsoft SQL Server 2022 Express Silent Uninstall (PowerShell) |
SQL Server 2022 Express Silent Uninstall (EXE)
- Open Notepad or your favorite text editor
- Add the following lines:
;SQL Server 2022 Configuration File
[OPTIONS]
ACTION="Uninstall"
QUIET="True"
FEATURES=SQLENGINE,REPLICATION
INSTANCENAME="SQLEXPRESS"
IACCEPTSQLSERVERLICENSETERMS="True"
Note: Features & InstanceName must match what is currently installed for this to work.
- Save the file and name it: ConfigurationFile_Uninstall.ini
- Copy the ConfigurationFile_Uninstall.ini file to “C:\Downloads\SQLEXPR_2022\“
- Open an Elevated Command Prompt by Right-Clicking on Command Prompt and select Run as Administrator
- Navigate to the C:\Downloads\SQLEXPR_2022 folder
- Enter the following command to uninstall SQL Server 2022 Express:
SETUP.EXE /ConfigurationFile=ConfigurationFile_Uninstall.ini |
SQL Server 2022 Express with Advanced Services Silent Uninstall (EXE)
- Open Notepad or your favorite text editor
- Add the following lines:
;SQL Server 2022 Configuration File
[OPTIONS]
ACTION="Uninstall"
QUIET="True"
FEATURES=SQLENGINE,REPLICATION,ADVANCEDANALYTICS,FULLTEXT,POLYBASECORE,LOCALDB
INSTANCENAME="SQLEXPRESS"
IACCEPTSQLSERVERLICENSETERMS="True"
Note: Features & InstanceName must match what is currently installed for this to work.
- Save the file and name it: ConfigurationFile_Uninstall.ini
- Copy the ConfigurationFile_Uninstall.ini file to “C:\Downloads\SQLEXPRADV_2022\“
- Open an Elevated Command Prompt by Right-Clicking on Command Prompt and select Run as Administrator
- Navigate to the C:\Downloads\SQLEXPRADV_2022 folder
- Enter the following command to uninstall SQL Server 2022 Express:
SETUP.EXE /ConfigurationFile=ConfigurationFile_Uninstall.ini |
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.