PROBLEM
When editing or displaying spatial data stored using SQL Server native spatial types, ArcGIS client applications may encounter the following errors:
Error: Could not complete cursor operation because the table schema changed after the cursor was declared.
Error: The app domain with specified version id (%d) was unloaded due to memory pressure and could not be found.
Error: [Microsoft][SQL Server Native Client 11.0][SQL Server]There are no rows in the current fetch buffer.
In the SQL Server error logs, the error is usually related to memory pressure forcing the Common Language Runtime (CLR) application domain to unload.
Note: By default, the error log is found in the following folder location: C:\Program Files\Microsoft SQL Server\MSSQL##.MSSQLSERVER\MSSQL\Log
Microsoft SQL Server spatial data types (Geometry and Geography) are implemented as CLR data types. When the application domain hosting the spatial data type structures is unloaded, the engine treats this as a schema change to the underlying objects referenced in the cursor. As a result, spatial queries while displaying and editing layers stored using either geometry or geography types may fail with related error messages when the schema change is detected.
Microsoft has released cumulative updates containing fixes that were released after the initial release of SQL Server and include the fix for the issue described in this article. The fixes for Microsoft SQL Server releases 2016, 2017, and 2019 can be found at the following links:
Note: This article was previously documented as KB 43036.
Get help from ArcGIS experts
Download the Esri Support App