In this article I am going to show you how to Completely Uninstall SQL Server Components which are left behind. In other words what to do if the regular uninstall process from Control Panel fails.
Even more, sometimes the control panel shows that the SQL component has been uninstalled. But when you try to reinstall, it fails again. And this is because of the left behind components.
There are many articles in the internet suggests to change registry entry. Modifying registry is always associated with risk. For me it didn’t work, may be because the registry was corrupted.
You need to use the MSI inventory tools to check and uninstall the components. I have made it available for you in the following link Download msiinv.zip
The original source is Download from One Drive
Once downloaded open Powershell and run the below command. In the below example I have downloaded the msiinv in D drive under msiinv folder. Please put valid paths and then run the command. This will create the out put file with all the GUID of the SQL Components.
PS D:\msiinv> .\msiinv.exe -s | Select-String "SQL Server" -Context 1,1 > D:\msiinv\msiinv_result1.txt
If the execution is successful it will go to the prompt again as shown below:
The result set will look like as below:
You can find out the components you want to remove and note the product code from the file.
Execute the below command in PowerShell to uninstall the component.
msiexec /x "{6BD8D100-B16C-409E-B0EA-BF508D7874EC}"
This will ask for final confirmation:
If you are not comfortable with PowerShell or facing issues, then you can use command prompt to use the msiinv tool as shown below:
Command to execute is as follows:
msiinv.exe -p > D:\msiinv\msiinv_result1.txt
The output file will have all the Windows components and not only SQL Server. You have to search through the file for SQL Server and use the same command as shown above to Uninstall SQL Server.
Sample file:
Thanks to the following post:
https://www.mssqltips.com/sqlservertip/4050/cleanly-uninstalling-stubborn-sql-server-components/