"CLR initialization error in SQL Server query operation 0x80004005"

Zhou, Qijun 0 Reputation points
2023-08-03T07:18:45.8133333+00:00

Steps to reproduce:

  1. Use SQL Server Management Studio to connect to the target SQL Server instance.
  2. Perform a specific query operation in the Query Editor, involving certain tables.(Only a few tables have this phenomenon)
  3. Error "Unable to initialize common language runtime (CLR) v4.0.30319 using HRESULT 0x80004005. You need to restart SQL Server to use CLR integration features. "

Environment Information:

  1. SQL Server edition:SQL Server 2019
  2. Operating system: Windows Server 2019
  3. CLR Configuration: true

Workaround tried:

  1. Restarting SQLServer has no effect
SQL Server Other
{count} votes

2 answers

Sort by: Most helpful
  1. LiHongMSFT-4306 31,566 Reputation points
    2023-08-03T08:34:41.8366667+00:00

    Hi @Zhou, Qijun

    Try running the following in the database that is giving you this problem:

    select * from sys.assemblies        --This is important to check.
    select * from sys.dm_clr_properties --This is important to check.
    

    Also, try reinstalling the .net framework or try repairing it using this tool:
    http://www.microsoft.com/en-us/download/details.aspx?id=30135

    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. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    2023-08-03T21:33:57.79+00:00

    What does "SELECT @@version" return? If the result does not say RTM-CU21, make sure you apply the most recent Cumulative Update.

    Also try the repair suggested by Cosmog.

    If none of these actions helps, I recommend that you open a support case with Microsoft. As this is something which is specific to your site, it is very difficult for us to assist. And furthermore, as this smells like a bug, opening a case is the only way you can get a fix.


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.