Microsoft released SQL Server 2019 CU21 and SQL Server 2022 CU5 in June 2023, delivering a combined total of over 30 bug fixes across both versions. If you're running either release in production, these cumulative updates address real stability issues including memory leaks, incorrect query results, and race conditions that can affect data integrity. SQL Server 2017 received no update in this cycle.

Keeping SQL Server patched isn't just good hygiene. Unpatched instances accumulate known defects that Microsoft has already solved, and in some cases those defects produce wrong query results or cause unexpected crashes. The fixes in CU21 and CU5 are exactly the kind of targeted, low-risk improvements that belong on every production server as part of a regular patching schedule.

Note: This article covers the June 2023 releases of SQL Server 2019 CU21 and SQL Server 2022 CU5. Both versions have since received additional cumulative updates. SQL Server 2019 is currently at CU30 (released April 2025) and SQL Server 2022 is currently at CU17 (released April 2025). The patching guidance and known issues documented here remain relevant, but if you're applying updates today, target the latest available CU for your version.

What Is a SQL Server Cumulative Update and Why Does It Matter?

A cumulative update (CU) is Microsoft's primary vehicle for delivering bug fixes between major service releases. Unlike general distribution releases (GDRs), which are reserved for security fixes only, cumulative updates bundle all previously released fixes plus new ones. Each CU is fully cumulative, meaning you don't need to apply earlier CUs first.

Microsoft's current servicing model recommends staying within one CU of the latest release for your SQL Server version. Falling more than two CUs behind means you're running with known defects that Microsoft has already fixed, and you're accumulating technical debt that makes future patching more complex.

Microsoft typically releases cumulative updates on a regular cadence, roughly every 4 to 8 weeks for actively developed versions. You can track current build numbers and release dates at sqlserverbuilds.blogspot.com or via the official Microsoft support pages for each version.

What Does SQL Server 2019 CU21 Fix?

SQL Server 2019 CU21 addresses a broad range of issues, with particular focus on In-Memory OLTP stability, query correctness, and change tracking. Here are the key fixes worth understanding before you deploy.

In-Memory OLTP improvements

Multiple issues around In-Memory OLTP have been resolved in this update. If your environment uses memory-optimised tables for high-throughput workloads, CU21 improves overall stability and reduces the risk of unexpected failures under concurrent load.

Query correctness fixes

Several fixes address scenarios where SQL Server was returning incorrect results:

  • Queries filtering on ROW_NUMBER() with nullable columns could produce wrong output. This is now fixed.
  • Multiple occurrences of the same scalar subquery in a single query could trigger access violations or return errors. Resolved.
  • Cardinality estimation for AND predicates has been improved, which can positively affect query plan selection for complex filter conditions.
  • Parallel spool operations in plans for INSERT, UPDATE, or DELETE statements could produce inconsistent results. This is fixed.

Change tracking cleanup

Enhanced change tracking cleanup behaviour when using trace flags 8286 and 8287. If you rely on change tracking for data synchronisation or auditing, this fix reduces the risk of cleanup processes interfering with active workloads.

Known Issues in SQL Server 2019 CU21

Two known issues shipped with CU21 that you need to be aware of before applying this update.

SESSION_CONTEXT and parallel plans

If your application uses SESSION_CONTEXT(), the fix introduced in CU14 has a side effect: it can generate access violation dump files when parallel plans are involved. Microsoft provided two workarounds using trace flags:

  • Trace flag 9432 disables the CU14 fix for SESSION_CONTEXT
  • Trace flag 11042 disables parallelism when SESSION_CONTEXT is in use

Neither workaround is ideal for high-concurrency environments, so test carefully before deploying to production. This issue was resolved in a subsequent CU, so if you're patching today rather than applying CU21 specifically, check the release notes for your target build to confirm the fix is included.

Managed Instance Link with memory-optimised tables

If you're using Managed Instance Link alongside memory-optimised tables, FileStream, or databases with multiple log files, the database may stop syncing after applying CU21. This is a specific scenario that doesn't affect most on-premises SQL Server deployments, but if you're using hybrid configurations with Azure SQL Managed Instance, review the CU21 release notes before proceeding.

What Does SQL Server 2022 CU5 Fix?

SQL Server 2022 CU5 covers similar ground to its 2019 counterpart, with targeted fixes for In-Memory OLTP, columnstore indexes, and Query Store behaviour.

In-Memory OLTP stability

Like CU21 for SQL Server 2019, CU5 addresses multiple stability issues with memory-optimised tables. If you're running In-Memory OLTP workloads on SQL Server 2022, this update is particularly relevant.

Memory leak with columnstore indexes

Queries using an equality predicate (=) against a clustered columnstore index were causing a memory leak under certain conditions. Over time, this leak can cause memory pressure on the SQL Server instance, leading to degraded performance or out-of-memory conditions. This fix is significant for environments using columnstore indexes for analytical workloads or data warehousing.

Race condition with parameter-sensitive plan optimisation

SQL Server 2022 introduced parameter-sensitive plan (PSP) optimisation as a new Intelligent Query Processing feature. CU5 resolves a race condition that could occur when PSP optimisation was active alongside Query Store. Race conditions in query plan management can cause intermittent errors or unexpected plan changes, so this fix improves the reliability of one of SQL Server 2022's headline features.

Incorrect results with DESC index sort order

Indexes with a DESC sort order could return incorrect results in specific query patterns. Index-related correctness bugs are among the most critical to patch because they can silently corrupt query output without raising any errors. This fix alone was a strong reason to apply CU5 promptly when it released, and it remains a reason to ensure you're running at least this build if you haven't patched since 2022 RTM.

For the complete list of fixes, refer to the official SQL Server 2022 CU5 release notes.

How Should You Approach Applying These Updates?

Cumulative updates should never be applied directly to production without a structured process. Here's a practical approach:

  1. Review the release notes for both the target CU and any CUs you're skipping. Check the known issues section specifically.
  2. Test in a non-production environment that mirrors your production workload as closely as possible. Run your critical queries and stored procedures to verify behaviour.
  3. Back up all databases before applying the update, including system databases.
  4. Schedule a maintenance window with enough time to apply the update and validate core application functionality before declaring success.
  5. Monitor after patching for at least 24 to 48 hours, watching for new errors in the SQL Server error log, unexpected plan changes, or performance regressions.
  6. Have a rollback plan. Cumulative updates can be uninstalled via Programs and Features in Windows, but test this process before you need it.

For environments running multiple SQL Server instances, stagger the rollout. Don't patch every instance simultaneously.

Which Versions Are Currently Supported?

SQL Server 2017 mainstream support ended in October 2022. It now receives security-only updates through the extended support period, which runs until October 2026. If you're still on SQL Server 2017, the window to plan a migration to SQL Server 2022 is narrowing.

SQL Server 2019 mainstream support ended in February 2025, with extended support available until February 2030. It continues to receive cumulative updates, currently at CU30, but with mainstream support now expired, new feature development has stopped.

SQL Server 2022 is the current recommended release, with mainstream support through January 2028 and extended support until January 2033. It's the only version still in active mainstream development and the right target for new deployments or upgrades today.

Key Takeaways

  • SQL Server 2019 CU21 and SQL Server 2022 CU5 together addressed over 30 known defects, including critical query correctness bugs and a memory leak affecting columnstore index workloads.
  • Both versions have received many additional cumulative updates since June 2023. SQL Server 2019 is now at CU30 and SQL Server 2022 is at CU17. Target the latest available CU when patching today.
  • The DESC index sort order fix in CU5 is a correctness bug that can silently return wrong results, making it a priority fix for any SQL Server 2022 environment still running an earlier build.
  • Always test cumulative updates in a non-production environment before deploying to production, and maintain a rollback plan.
  • SQL Server 2017 extended support ends October 2026 and SQL Server 2019 is now in extended support only. If you're running either version, start planning your upgrade to SQL Server 2022.

Keeping up with cumulative updates is one part of maintaining a healthy SQL Server environment, but it's rarely the whole picture. At DBA Services, our SQL Server health checks identify patching gaps, configuration issues, and performance risks across your entire SQL Server estate. If you'd prefer ongoing coverage rather than reactive patching, our managed DBA support service handles cumulative update assessment, testing, and deployment as part of a structured maintenance programme. Get in touch to find out how we can help.