How to fix Error 8784 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 8784 – Unsupported Operator in Memo XML

Why This Error Happens

Error 8784 occurs when SQL Server’s Query Optimizer attempts to generate a “Memo” structure (an internal representation used during query plan exploration) that includes an operator which cannot be properly serialized or represented in the Showplan XML schema. This typically arises from internal optimizer state corruption, an outdated query processing engine encountering a newer or experimental T-SQL construct, or a bug triggered by complex nested queries, CTEs, or features like Intelligent Query Processing interacting unexpectedly with trace flags. In rare cases, it is also linked to corrupted plan cache entries or incompatible Database Compatibility Level settings following an in-place upgrade to SQL Server 2025.

Step-by-Step Resolution Guide

Step 1: Verify Database Compatibility Level and Cumulative Updates

  • Run SELECT name, compatibility_level FROM sys.databases; to confirm the affected database is set to the correct level for SQL Server 2025 (170).
  • Check Windows Server 2025 / Windows 11 for the latest SQL Server 2025 Cumulative Update via SELECT @@VERSION; and compare against the Microsoft release notes, as optimizer bugs causing 8784 are frequently patched quickly.
  • Install any pending CU using the standalone setup package if the build number is outdated.

Step 2: Clear the Plan Cache and Retry the Query

  • Execute DBCC FREEPROCCACHE; to remove potentially corrupted or malformed cached execution plans.
  • Alternatively, isolate the specific plan using DBCC FREEPROCCACHE (plan_handle); to avoid a full cache flush on production servers.
  • Re-run the failing query in isolation to confirm whether the cached plan was the root cause.

Step 3: Disable Problematic Query Processing Features

  • Add trace flag 9481 (legacy Cardinality Estimator) or disable Intelligent Query Processing features using ALTER DATABASE SCOPED CONFIGURATION SET DISABLE_FEATURE_NAME = ON; for recently added features like memory grant feedback or batch mode processing.
  • Test with OPTION (USE HINT('DISABLE_OPTIMIZER_ROWGOAL')) or similar query hints to isolate which operator triggers the Memo XML failure.
  • Simplify complex CTEs or nested subqueries into temp tables as a workaround while the root query is investigated.

Step 4: Check for Corruption in System Catalogs

  • Run DBCC CHECKDB (YourDatabaseName) WITH NO_INFOMSGS, ALL_ERRORMSGS; to rule out underlying data or index corruption influencing plan generation.
  • Review the SQL Server Error Log (Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for correlating stack dumps or memory errors around the time Error 8784 was raised.

Alternative or Verification Steps

  • Re-execute the original failing query with SET SHOWPLAN_XML ON; to confirm the optimizer now generates a valid execution plan without throwing Error 8784.
  • If the error persists after patching and cache clearing, open a Microsoft Support ticket and attach the query text along with a memory dump, as this specific error often requires a hotfix for a newly identified optimizer edge case in SQL Server 2025.