In this article, we’ll look at several ways to uninstall Microsoft SQL Server from a Windows computer.
Uninstalling an MS SQL Instance Using the Installer
You can use the source install image to properly uninstall Microsoft SQL Server. Mount the SQL installation ISO image and run a command prompt as an administrator. To remove the default MSSQL instance, use the following command:
setup.exe /ACTION=UNINSTALL /FEATURES=SQL /INSTANCENAME=MSSQLSERVER
- Specify the list of SQL features to be removed in the /FEATURES option;
- /INSTANCENAME – specifies the name of the SQL Server instance to be removed.
Or, you can simply run the command:
setup.exe /ACTION=UNINSTALL
If multiple instances of MS SQL are installed on the computer, the Remove SQL Server graphical dialog box will appear, in which you need to select the name of the MSSQLSERVER instance you want to uninstall.
Next, you need to select the SQL components that you want to remove and click Next.
This method only removes features included with the SQL Server distribution. Additional components such as SQL Server Management Studio or Reporting Services must be uninstalled separately.
Uninstall SQL Server via Windows Control Panel
If you don’t have a SQL Server install image, you can remove SQL Server as a standard Windows application from the Control Panel. Go to Settings -> Apps & Features (or run ms-settings:appsfeatures
) and find your version of Microsoft SQL Server in the list. Click the Uninstall button and then Remove.
Uninstalling SQL Server Using MSIEXEC?
You can use the built-in Windows Installer tool (msiexec) to remove programs. In order to remove any program installed through the Windows Installer, you need to run the following commands:
msiexec /x {guid}
To get the GUID of MS SQL Server applications on Windows, run the command:
wmic product get Name,IdentifyingNumber
Each SQL Server component has its own GUID. To remove a specific feature, find it in the list, copy its GUID, and run the command:
msiexec /x {2C33F4D4-E9A5-4DE1-ACFE-3A13464E6703}
Confirm the removal of the SQL Server product feature.
Similarly, you need to remove other components of SQL Server.