Microsoft has documented a SQL Server 2025 issue in CU8 and CU7 where queries against sys.dm_exec_requests can raise an access violation if they run while a database is still recovering. In the documented cases, the problem can appear during a database restore, during startup recovery, or before an availability group replica finishes coming online.

The SQL Server error log can contain entries related to the failure, and Microsoft says the behavior stems from an internal in-memory structure being referenced before it is fully initialized.

Affected releases

  • SQL Server 2025 CU8 (KB5104822, build 17.0.4075.5)
  • SQL Server 2025 CU7 (KB5096981, build 17.0.4065.4)

What Microsoft says

Microsoft says it is aware of the issue and is investigating a fix. Until a fix is available, the documented mitigations are:

  • Enable trace flag 4696 to opt out of the code change associated with the issue.
  • Avoid querying sys.dm_exec_requests for databases that are recovering.
  • Uninstall the update.

Microsoft also notes that if trace flag 4696 is enabled, monitoring queries that use sys.dm_exec_requests or sys.sysprocesses on secondary replicas might return error 976 or error 978, as they did before the update.

Example scenario

An illustrative case is a server that is still bringing a database online after restore or startup recovery. If a monitoring query runs against sys.dm_exec_requests before recovery completes, the documented issue can occur.

Removal of this issue from a source page would not by itself prove the problem was resolved.

Official source