SQLTeam.com | Weblogs | Forums

Uninstall a single server instance through the registry

Hello All, I'm running SQL Server 2014 and have 50 separate instances running. This is the max limit of number of instances for this version and I obviously need to uninstall some instances and clean up.

However upon research it looks like there's a bug which won't allow you to uninstall instances through the Programs and Features installer or command line when you have 50 instances installed. The installer freezes or hangs when querying the list of instances and never moves forward to uninstall. I checked the bootstrap log files and the exported errors state that it can't perform the operation because there are too many instances which is the whole problem in the first place!

The only solution I've found is to uninstall the instance through the registry. I was able to remove the instance from HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall using msiexec but when I did that the SQL Browser service crashed, the other sql instances lost connection and the services for the old instance would reappear. I ended up restoring the registry from the backup I made. Is there a way to remove an instance from the registry properly and re-situate the browser service? Maybe some registry items I'm missing?

be vewy vewy careful with registry edits. you could end up doing some major booboo

Maybe you should rather use a MS SQL Server install media to do this

1 Like

The registry route is definitely not my preference to uninstall this instance but I'm not able to install through the regular methods.

Through the Programs and Features uninstall method the windows log is as follows:

Source: Application Hang, The program ScenarioEngine.exe version 12.0.4 stopped interacting with Windows and was closed. Event ID 1002

The cmd line uninstall result with the /Q parameter error (which is the same error as the Summary.txt log ) is as follows:

The following error occurred:

SQL Server 2014 cannot add any more instances. To continue installing this instance, you must uninstall an existing instance.

Error result: -2146233079

Result Facility code: 19

Result error code: 5385

Any help would be appreciated.


I've figured out the solution for this based on an order of operations. This resolved my issue.

-Stop the SQL Browser service

-SC Delete the SQL Server service for the particular erroneous instance

-Run the uninstall command from the setup.exe using the installer disk Setup.exe /Action=Uninstall /FEATURES=SQLEngine /INSTANCENAME= MyInstance /Q

-(The SQL Server Agent service for the erroneous instance will disappear)

-Start the SQL Browser service

-Uninstall subsequent erroneous instances through Programs and Features as this will now complete without hanging.

1 Like