Trying to uninstall SQL Server, completely

Weitz, Mark R 0 Reputation points
2023-03-16T19:58:29.0033333+00:00

I am attempting to uninstall SQL Server completely from my VDI.

The first attempts I tried had issues with account access issues but was told to run gpupdate /force from an elevated command prompt (run as administrator).

User's image

Once I got past that then I had the error "There are no valid SQL Service 2019 features to perform this operation.

User's image

I stopped all the running SLQ Server services (e.g., SQLEXPRESS, CEIP service, and VSS Writer) and was able to get past that and started following the steps outlined here: https://learn.microsoft.com/en-us/sql/sql-server/install/uninstall-an-existing-instance-of-sql-server-setup?redirectedfrom=MSDN&view=sql-server-ver16&tabs=Windows10

Then I select all the features that are displayed and continue through to a successful "removal".

User's image

User's image

User's image

However, at the end of this I am surprised that the SQL Server services still exist and when I reboot come up as running. (The highlighted ones I have stopped, but show as Running upon reboot).

User's image

I am surprised that the Microsoft SQL Server/MSSQL15.SQLEXPRESS folder still exists (taking up 1.4 GB of space).

User's image

And I am surprised that Microsoft SQL Server 2019 (64-bit) continues to show up on the Apps & Features window as an app that I can uninstall. I thought I just successfully uninstalled it. In fact, I was able to go through the "uninstall" a second time with the exact same results. How do I get rid of SQL Server completely from my VDI?

User's image

Summary_USV-PC36004-109_20230316_155013.txt

SQL Server Other
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. LiHongMSFT-4306 31,566 Reputation points
    2023-03-17T07:04:27.68+00:00

    Hi @Weitz, Mark R

    Notice that there is not select instance in the left page. You might not be running the correct program version, or you might not be on the server you are trying to uninstall the SQL Server instance from.

    User's image

    You need to specify the instance you want to remove.

    When you uninstall SQL Server, you have to select the correct program in the "Progams & features" windows. It should be the program with no size.

    User's image

    Then follow by the steps in this doc: Uninstall an existing instance of SQL Server (Setup)

    Best regards,

    Cosmog Hong


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Weitz, Mark R 0 Reputation points
    2023-03-20T21:37:50.6533333+00:00

    Instead of using the installer from the Add/Remove Programs, I opened a (Administrator) command window and ran setup from the command line and got another failure.

    C:\Program Files\Microsoft SQL Server\150\Setup Bootstrap\SQL2019>setup /ACTION=UNINSTALL /FEATURES=SQL /INSTANCENAME=MSSQLSERVER

    The following error occurred:

    Instance Name MSSQLSERVER for product Microsoft SQL Server doesn't exist. Specify a valid instance name.

    Error result: -2068578302

    Result facility code: 1204

    Result error code: 2

    Please review the summary.txt log for further details

    Upon further digging I found that my instance name is SQLEXPRESS instead of MSSQLSERVER and this time the uninstaller gave me options for my SQLEXPRESS instance and it got mostly through the uninstall. It completed with a failure on the Setup Support Files feature. I'm attaching logs that might help.

    User's image

    Summary_USV-PC36004-109_20230320_171414.txt

    sql_engine_core_shared_Cpu64_1.log

    In the sql-engine-core-shared log (sorry, can't type underscores for the log name), I see error 1722 for the

    SQL Server 2019 Database Engine Shared.

    I can see that the 4 services for SQL Server no longer exist, so at least the uninstall partly worked.

    I will continue digging for an answer as the Program Files/Microsoft SQL Server directory is still taking 1.4 GB of space that I would like to free up.

    0 comments No comments

  3. LiHongMSFT-4306 31,566 Reputation points
    2023-03-21T02:30:56.6666667+00:00

    Hi @Weitz, Mark R

    Before you uninstall your SQL Server, it is recommended that you stop all SQL Server services before you uninstall SQL Server components. Active connections will prevent successful uninstallation.

    Please refer to this similar thread which involves deleting SQL-related keys using Regedit.

    Best regards,

    Cosmog Hong

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.