How to Remove Stuck SQL Server Services After a Failed Cluster Installation


Problem:
A friend encountered an issue while installing SQL Server in a clustered environment. The installation stopped midway, and he was unable to remove SQL Server using Add/Remove Programs or the SQL Server Setup. Even after manually deleting registry entries and folders, SQL Server services were still visible in Services.msc.

Solution:
If you face a similar issue, follow these steps to completely remove SQL Server services:

Step 1: Delete SQL Server Services Using SC Command

Open Command Prompt as Administrator and run the following commands:


sc delete sqlserveragent sc delete mssqlserver

This will remove the SQL Server Agent and SQL Server (MSSQLSERVER) services. If you are using a named instance, replace mssqlserver with mssql$<InstanceName>.

Step 2: Delete SQL Server Services from Registry

Since the services might still be registered in the Windows registry, follow these steps to clean up:

  1. Press Win + R, type regedit, and hit Enter.
  2. Navigate to the following path:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
  3. Look for entries related to SQL Server, such as:
    • MSSQLSERVER
    • SQLSERVERAGENT
    • MSSQL$InstanceName (for named instances)
  4. Right-click each SQL-related entry and Delete them.
  5. Close Registry Editor and restart the system.

After performing these steps, the SQL Server services should be completely removed from the system.

No comments:

Post a Comment