Out of nowhere we started seeing this error and it seems to occur fairly frequently when making calls to the database or any other database in our Elastic Pool. The DTUs aren't being maxed out and the resource dmvs don't seem bad.

Failed to enter Common Language Runtime (CLR) with HRESULT 0x80131022. This may be due to low resource conditions. (db)

Here's what I got from the system resource governor pool

Resource Pool Name           cache_memory (MB)   used_memory (MB)
internal                     104.773437          1577.125000
default                      37.609375           38.796875
SloSecSharedPool             2.914062            8.156250
InMemBackupRestorePool       26.210937           101.437500
InMemDmvCollectorPool        186.195312          203.406250
InMemMetricsDownloaderPool   2.234375            2.250000
InMemDTAPool                 0.000000            0.000000
SloHkPool                    0.000000            0.031250
InMemQueryStorePool          22.453125           35.304687
InMemWIAutoTuningPool        3.312500            4.062500
InMemXdbLoginPool            3.976562            6.250000
PVSCleanerPool               0.000000            0.000000
InMemTdeScanPool             0.000000            0.000000
SloSharedPool1               1108.890625         1234.312500

From the sys.dm_os_performance_counters this is what it looks like for the past 3 hours.

cpu%    data_io%   log_write%   memory_usage%   max_worker%   sessions%
22.37   73.51      16.54        41.56           5.50          0.43

This doesn't seem like a common error for SQL Azure as I cannot find anything that pertains to this happening past SQL Server 2008. Any help would be appreciated.


We got a response from the Microsoft support rep and it looks like our memory usage was completely capped out.

Elastic Pool resource usage

After moving the elastic pool up a tier the error has gone away. We have ~56GB of memory instead of the ~28GB we had previously and the error ceased. This would have probably also moved us to a different server on Azure which may have fixed the problem for now. The site has been running at around 78% on memory usage with the buffer cache hit ratio @ 8588 and PLE of 87332. Now it's operating at usage under 2% across the board for CPU, Workers, DataIO, etc. during normal load which seems like a huge waste.

We could not definitively identify what was causing the errors but we assume it was the complete memory usage as the site is running fine for now...


While Azure SQL Database (not the new Managed Instance) does not support custom SQLCLR Assemblies (i.e. the "CLR enabled" server-level configuration option), CLR is still used internally for the following features:

  1. CLR datatypes:
    • Geometry
    • Geography
    • Hierarchyid
  2. SSIS (Fuzzy Lookup / sp_FuzzyLookupTableMaintenanceInvoke, etc)
  3. Built-in functions:
    • FORMAT
    • PARSE
    • TRY_PARSE (but not TRY_CONVERT)
    • COMPRESS (but not UNCOMPRESS ; introduced in SQL Server 2016)
    • AT TIME ZONE (introduced in SQL Server 2016)
    • maybe others
  4. Change Data Capture (CDC)
  5. Replication
  6. maybe others

Of course, this does not point to what would be hogging memory. But it should help identify the affected area(s).


As you can read on this documentation, CLR is not supported on Azure SQL Database. However, the new Azure Managed Instance does support CLR.

  • Thank you for providing those resources. I read through and we don't actually use anything CLR related. – Brandon Huber Jul 26 '18 at 21:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.