SQL Server Express unintall/reinstall issue - Microsoft Q&A (2024)

Share via

SQL Server Express unintall/reinstall issue - Microsoft Q&A (1)

Holbrook, John 1Reputation 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,171 questions

Sign in to follow

0{count} votes

  1. SQL Server Express unintall/reinstall issue - Microsoft Q&A (2)

    Erland Sommarskog 105KReputation points MVP

    2021-06-08T21:29:15.39+00:00

    Have you check the log files in C:\Program Files\Microsoft SQL Server\150\Setup Bootstrap\Log? There is one folder for each setup operation.

  2. SQL Server Express unintall/reinstall issue - Microsoft Q&A (3)

    Holbrook, John 1Reputation point

    2021-06-08T22:11:37.23+00:00

    Unfortunately, the reinstall does not get far enough to create that folder, I only have the SqlSetup.log file:

    06/03/2021 16:09:26.034 Attempting to run user requested action from media ScenarioEngine.exe
    06/03/2021 16:09:26.034 Attempting to launch process C:\Sievers\DataPro2\SQLEXPR_x64_ENU\x64\ScenarioEngine.exe
    06/03/2021 16:09:27.547 Process returned exit code: 0xC0000005
    06/03/2021 16:09:27.547 Media ScenarioEngine.exe returned exit code: 0xC0000005
    06/03/2021 16:09:27.547 Attempting to release setup mutex
    06/03/2021 16:09:27.547 Setup mutex has been released
    06/03/2021 16:09:27.547 Setup closed with exit code: 0x84C40013
    06/03/2021 16:09:27.547 ======================================================================

  3. SQL Server Express unintall/reinstall issue - Microsoft Q&A (4)

    Erland Sommarskog 105KReputation points MVP

    2021-06-09T21:24:20.733+00:00

    I guess then, it's time to get Process Monitor from www.sysinternals.com to see what Setup is trying to access and where it fails with Access denied.

    Keep in mind that Access denied can either be a permissions issue, or that a file is locked by another process.

  4. SQL Server Express unintall/reinstall issue - Microsoft Q&A (5)

    CarrinWu-MSFT 6,866Reputation points

    2021-06-15T01:37:17.937+00:00

    Hi @Holbrook, John , we have not get a reply from you. Did any answers could help you? If there have any answers helped you, please do "Accept Answer". If not, please let us know. By doing so, it will benefit for community members who have this similar issue. Your contribution is highly appreciated. Thank you!

  5. SQL Server Express unintall/reinstall issue - Microsoft Q&A (6)

    Holbrook, John 1Reputation point

    2021-06-15T13:45:58.067+00:00

    Carrin, still working the issue. I think Process Monitor has the most potential to find the cause, but I just haven't had time to work on it lately.

Sign in to comment

1 answer

Sort by: Most helpful

Most helpful Newest Oldest

  1. SQL Server Express unintall/reinstall issue - Microsoft Q&A (7)

    CarrinWu-MSFT 6,866Reputation 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.

    1. SQL Server Express unintall/reinstall issue - Microsoft Q&A (8)

      Holbrook, John 1Reputation point

      2021-06-09T18:57:21.717+00:00

      Carrin, thanks for your post, unfortunately that is the first thing I tried and it did not fix the issue.

    2. SQL Server Express unintall/reinstall issue - Microsoft Q&A (9)

      CarrinWu-MSFT 6,866Reputation points

      2021-06-10T01:57:31.267+00:00

      06/03/2021 16:09:26.034 Attempting to run user requested action from media ScenarioEngine.exe
      06/03/2021 16:09:26.034 Attempting to launch process C:\Sievers\DataPro2\SQLEXPR_x64_ENU\x64\ScenarioEngine.exe
      06/03/2021 16:09:27.547 Process returned exit code: 0xC0000005
      06/03/2021 16:09:27.547 Media ScenarioEngine.exe returned exit code: 0xC0000005

      According your information, it seems that there is no permission to access C:\Sievers\DataPro2\SQLEXPR_x64_ENU\x64\ScenarioEngine.exe, and ScenarioEngine.exe will check glob rule, check if a patch needs to be installed and so on. So please check you have enough permission to access there. And as Erland mentioned, you could use Process Monitor v3.82 to get more detail of the process.

    Sign in to comment

Sign in to answer

SQL Server Express unintall/reinstall issue - Microsoft Q&A (2024)
Top Articles
Latest Posts
Article information

Author: Van Hayes

Last Updated:

Views: 6156

Rating: 4.6 / 5 (66 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Van Hayes

Birthday: 1994-06-07

Address: 2004 Kling Rapid, New Destiny, MT 64658-2367

Phone: +512425013758

Job: National Farming Director

Hobby: Reading, Polo, Genealogy, amateur radio, Scouting, Stand-up comedy, Cryptography

Introduction: My name is Van Hayes, I am a thankful, friendly, smiling, calm, powerful, fine, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.