Issue with SQL Server 2022 RTM GDR (KB5046861) Update - Error code (Install error - 0x851a0020)

Havaji69 0 Reputation points
2025-05-09T11:47:12.7733333+00:00

Greetings,

I need help with an issue I’ve been experiencing for the past month. Below is a short description of the problem:

I regularly install Windows updates, and about a month ago I encountered an issue with installing the SQL Server update (KB5046861). The update downloads and attempts to install, but ultimately fails.

SQLServer2022_Install_Fail

I searched various forums and discovered that the issue appears to be related to an instance called TEW_SQLEXPRESS. Since I’m not an IT technician, I made the mistake of going into the registry to investigate. I found that this SQL instance was tied to software I had previously installed on an external hard drive, which I later deleted. However, as noted on the forums, the registry keys were not removed.

So off course I found the registry --> Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL16.TEW_SQLEXPRESS

Then, unfortunately, I deleted any keys that referenced the now non-existent drive (e.g., G:..., without making a backup). I know this wasn’t the best idea, but I assumed it wouldn’t cause harm since the SQL Server was no longer functional anyway. I left the rest of the registry keys intact and still have the ones listed in the file path above.

Here’s what I’ve tried so far:

  • Installed SSMS to try to connect to TEW_SQLEXPRESS — it failed.
  • Installed a new SQL Server Express — this worked and installed new SQL Server Express, but repairing the TEW_SQLEXPRESS still failed. SQLServer2022_Update_1 SQLServer2022_Update_2 SQLServer2022_Update_3_Error
  • Attempted to uninstall Microsoft SQL Server 2022 (64-bit) via “Add or Remove Programs,” selecting only the TEW_SQLEXPRESS — the removal failed.

SQLServer2022_Remove_1

SQLServer2022_Remove_2

  • Tried manually installing the latest cumulative update for SQL Server 2022 (KB5050771) — this also failed.

At this point, I gave up on trying to update SQL Server 2022 RTM GDR (KB5046861) and removing the error from the Windows Update screen.

Here are my questions:

How can I fully remove the TEW_SQLEXPRESS?

Since this server was linked to already uninstalled software, can I safely remove it from the registry and Program files — and if so, how?

How can I find out if this TEW_SQLEXPRESS is perhaps used for something else I have on my PC?

  1. How can I get the Windows Update for SQL Server 2022 to install successfully?
  2. Is it worth fixing this, or is it harmless to leave as-is?

Thank you for your help and time.

Best regards

p.s: I am also adding both logs from my tries.

Summary_Karlopad_20250509_105842.txt

Summary_Karlopad_20250509_102319.txt

SQL Server Database Engine
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Erland Sommarskog 120.4K Reputation points MVP Moderator
    2025-05-09T20:42:52.01+00:00

    Here is a post that you can try: https://www.sql-easy.com/learn/how-to-uninstall-sql-server/

    But given that you have been fiddling around in the registry, I would not be surprised if it does not work out. As long as you the instance actually does not cause any problem, saved for the failed Windows Update, it may be better to leave things as they are. There is a risk that if you attempt something that you make matters worse.

    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.