How to perform unattended uninstall for SQL Server Express
Recently, I received a question about unattended uninstall for SQL Server Express edition. This article describes how to perform this task.
We need to take in consideration before to proceed
User that performs the process must be a local administrator with permissions to log on as a service. You can review more information about required permissions here.
If the machine has the minimum required amount of physical memory, increase the size of the page file to two times the amount of physical memory. Insufficient virtual memory can result in an incomplete removal of SQL Server.
On a system with multiple instances of SQL Server, the SQL Server browser service is uninstalled only once the last instance of SQL Server is removed. The SQL Server Browser service can be removed manually from Programs and Features in the Control Panel.
Uninstalling SQL Server deletes tempdb data files that were added during the install process. Files with tempdb_mssql_*.ndf name pattern are deleted if they exist in the system database directory.
Backup your databases.
Uninstall process
Open Command Prompt with admin rights
Navigate to the below directory
C:Program FilesMicrosoft SQL Server160Setup BootstrapMyInstanceName
Please note that 160 version is the major build version of SQL Server.
C:>cd C:Program FilesMicrosoft SQL Server160Setup BootstrapSQL2022
Run the below command
C:Program FilesMicrosoft SQL Server160Setup BootstrapSQL2022>setup.exe /Q /ACTION=uninstall /INSTANCENAME=SQLEXPRESS /FEATURES=SQLENGINE
For more information on uninstall options, see
Hope this helps!
Idalia – SQL Server CSS
Microsoft Tech Community – Latest Blogs –Read More