SQL Server Express unintall/reinstall issue

Holbrook, John 1 Reputation point
2021-06-08T14:31:15.03+00:00

We have three C# application that use SQL Server Express 2019. We are installing on 64-bit machines running Windows 10 Enterprise version 2004. As it happens, the three applications each use a different installer, one uses Inno Setup, one uses WiX and the other uses NSIS. All three wrap the installer for SQL Server Express 2019. All three have the same issue. The first install works fine, then as part of our testing, we uninstall the instance and the uninstall appears to work. However if we try to reinstall, it fails with an exit code of 0xC0000005. After that, we have tried everything to completely remove SQL Server and have not been able to fix the issue. The only way to recover from this is to reimage the machine.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,672 questions
{count} votes

1 answer

Sort by: Most helpful
  1. CarrinWu-MSFT 6,871 Reputation points
    2021-06-09T05:09:45.507+00:00

    Hi @Holbrook, John ,

    Welcome to Microsoft Q&A!

    Please follow below steps to delete the left components first:

    1. Uninstall the existing SQL Server and all the components from the add remove program.
    2. Backup the registry.
    3. Delete the following keys using regedit:
      --HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server
      --HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer
    4. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall and delete all the sub-keys referencing SQL Server.
    5. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services and delete all the keys referencing SQL Server.
    6. Rename all the SQL Server folders in the computer.
    7. Reboot the machine.

    Setup closed with exit code: 0x84C40013

    This error maybe caused by permission issue. Have you right click and select 'run as a administrator' when you install SQL Server? Please refer to this blog, it might be helpful.

    Best regards,
    Carrin


    If the answer is helpful, please click "Accept Answer" and upvote it.
    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.


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.