Blog Post

SQL Server Support Blog
2 MIN READ

How to perform unattended uninstall for SQL Server Express

IdaliaL's avatar
IdaliaL
Icon for Microsoft rankMicrosoft
Jun 25, 2024

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 

  1. Open Command Prompt with admin rights
  2. Navigate to the below directory 

    C:\Program Files\Microsoft SQL Server\160\Setup Bootstrap\MyInstanceName

    Please note that 160 version is the major build version of SQL Server.

    https://docs.microsoft.com/en-us/sql/database-engine/install-windows/view-and-read-sql-server-setup-log-files?view=sql-server-ver15

     

    C:\>cd C:\Program Files\Microsoft SQL Server\160\Setup Bootstrap\SQL2022
  3. Run the below command
    C:\Program Files\Microsoft SQL Server\160\Setup Bootstrap\SQL2022>setup.exe /Q /ACTION=uninstall /INSTANCENAME=SQLEXPRESS /FEATURES=SQLENGINE

     

     

For more information on uninstall options, see 

https://learn.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt?view=sql-server-ver16#Uninstall

 

Hope this helps!

 

Idalia - SQL Server CSS

Updated Jun 25, 2024
Version 1.0
No CommentsBe the first to comment