Skip to the content
The Update Bureau
SQL Server 2022 CU15 SQL Server 2022 CU15 Cumulative update

KB5041321

KB5041321: Cumulative update for SQL Server 2022, CU branch, September 2024. VSS backups and replication errors fixed; SESSION_CONTEXT issue remains

In short

Includes 14 fixes for SQL Server 2022, including problems with VSS backups and replication. Queries using SESSION_CONTEXT can still return incorrect results or cause access violation dumps in parallel plans.

Does it affect you? Applies to: Instances running SQL Server 2022. The package applies to all supported languages and updates only the SQL Server components installed on the instance.

Build
16.0.4145.4
Servicing branch
CU
Restart
Required
Review notes Additional details from the official release notes (1) Read note
  • This page In CU15, setup can initially fail when patching an availability-group database with replication or CDC enabled, although patching completes after SQL Server starts again. CU16 fixes this issue.

The official sources are linked at the end of the page.

For servers on the CU branch: they install cumulative updates, which also bring fixes beyond security. Servers on the GDR branch (security fixes only) get a separate update. Which branch am I on?

What changes

Fixes 10 changes

Master Data Services

  • Domain accounts can be validated in the configuration tool after authentication fails with the usual formats.1
    Adds an automatic retry to account validation using UPN format and three authentication methods after authentication fails in SAM format and the default method.

Backup Restore

  • VSS-based backups can freeze the database through the SQL Server VSS Writer.2
    Fixes the SQL Server VSS Writer failing to freeze the database during a VSS-based backup.

High Availability and Disaster Recovery

  • Creating a distributed availability group no longer triggers an assertion failure when its group count is set to a number other than two.3
    Fixes an assertion failure when creating a distributed availability group and specifying a number of availability groups other than two.

Metadata

  • Changing the database owner on a readable secondary replica no longer triggers an assertion failure.4
    Fixes an assertion failure when changing the database owner on a readable secondary replica of an Always On availability group.

PolyBase

  • PolyBase can start when the SQL Server instance listens on multiple TCP ports.5
    Fixes a startup System.ArgumentException that reports it cannot parse a port when the instance listens on multiple TCP ports.

Replication

3 items
  • Running sp_validate_redirected_publisher with a case-sensitive collation no longer returns error 21890.6
    Fixes error 21890 when running sp_validate_redirected_publisher with a case-sensitive collation.
  • A checkpoint on a database with change tracking no longer encounters error 2601 from a duplicate key.7
    Fixes error 2601 during a checkpoint operation on a database with change tracking enabled.
  • Transactional replication no longer stops with error 18752 in the described heavy-workload and availability-group failover scenario.8
    Fixes error 18752 after a failover when a heavy workload is combined with availability groups.

Temporal

  • Table and column names are quoted correctly in some internal SQL Server batches for temporal-table stored procedures.9
    Fixes quoting of table and column names read from database metadata when building internal batches in stored procedures that manage temporal tables.

Transaction Services

  • RESTORE WITH STANDBY operations are less slow when accelerated database recovery is disabled.10
    Fixes slowness in RESTORE WITH STANDBY operations when accelerated database recovery (ADR) isn't enabled.

Improvements 3 changes

Master Data Services

  • Master Data Services uses updated checks to identify the current machine type and whether it is a domain controller.11

Query Execution

  • PREDICT checks that its MODEL parameter is valid, helping avoid errors caused by an incorrect model.12
    Adds validation for the MODEL parameter when running PREDICT.

Storage Management

  • Starting or stopping Extended Events sessions is no longer recorded in the SQL Server error log by default.13
    Trace flag 9714 enables logging of Extended Events session starts and stops.

New feature 1 change

Replication

  • A new CDC metadata security feature helps prevent errors when upgrading a database that has CDC disabled.14
    Adds change data capture (CDC) metadata data definition language (DDL) lockdown to prevent errors when running sp_cdc_vupgrade against a database with CDC disabled.

Known issues

  1. Open Affects: Organizations and IT administrators

    Incorrect behavior of SESSION_CONTEXT in parallel plans

    Queries using SESSION_CONTEXT might return incorrect results or trigger access violation dump files in parallel query plans, particularly if the session is reset for reuse.15

    Workaround status No workaround yet

    Microsoft has not published a manual workaround for this issue yet. Monitor release health until a resolving update is available.

  2. Resolved Affects: Organizations and IT administrators Resolved by KB5036432

    Issue three: Patching error for secondary replicas in an availability group with databases enabled replication or CDC

    Setup can initially fail when patching an availability group database with replication or CDC enabled because the catalog upgrade scripts cannot access the database in single-user mode. SQL Server starts again without single-user mode and completes patching; CU16 fixes this issue.16

    How to apply the workaround SQL Trace Flag

    Before running the patch, enable Trace Flag 12347 and remove it after patching, or remove the affected database from the availability group or remove CDC or replication from that database.16

    Step-by-step workaround instructions
    4 steps
    Show steps Hide steps
    Step-by-step procedure
    1. Before running the patch, choose one of the following options.
    2. Enable Trace Flag 12347, then remove it after patching.
    3. Drop the CDC- or replication-enabled database from the availability group.
    4. Remove CDC or replication from the database in the availability group.

Technical details

Data sheet · Security · Downloads · Components Click to collapse or expand

Data sheet

Released
2024-09-25
Classification
Updates
Type
Cumulative update
Servicing branch
CU
Restart
Required
Replaces
KB5038325, KB5036432, KB5033663, KB5032679
Replaced by
KB5046059
VersionBuildChannel
2022 16.0.4145.4 General availability

Security

No vulnerabilities are listed for this update.

Downloads (Microsoft Update Catalog)

Sources

Updated
Cited passages from Microsoft's official notes (16)
  1. 1. Fixes a domain account authentication issue in the configuration tool by adding an auto-retry method to the account validation part, which will use the UPN format and try to authenticate using three separate authentication methods after the authentication fails in SAM format and default. support.microsoft.com
  2. 2. Fixes an issue in which the SQL Server Volume Shadow Copy Service (VSS) Writer can't freeze the database during a VSS-based backup. support.microsoft.com
  3. 3. Fixes an assertion failure (Location: ListenerSpec.cpp:480; Expression: totalUsed + cbListenerName <= cbObj) that you encounter when creating a distributed availability group (DAG) and incorrectly specifying the number of availability groups in it to be other than two. support.microsoft.com
  4. 4. Fixes an assertion failure (Location: MetadataVersion.cpp:71; Expression: !CFeatureSwitchesMin::GetCurrentInstance()->FEntityVerStoreCsnCheckEnabled() || newInfo != InvalidXts()) that you encounter when you try to change the database owner on a readable secondary replica of an Always On availability group. support.microsoft.com
  5. 5. Fixes an issue in which PolyBase throws the following error at service startup if the SQL Server instance is configured to listen on multiple TCP ports: System.ArgumentException: Unable to parse port support.microsoft.com
  6. 6. Fixes the following error 21890 that you encounter when you use the case-sensitive collation and run sp_validate_redirected_publisher support.microsoft.com
  7. 7. Fixes an issue with checkpoint operation in which the following error 2601 occurs when SQL Server tries to perform a checkpoint operation on the database that has change tracking enabled support.microsoft.com
  8. 8. Fixes an issue in which error 18752 occurs and transactional replication stops working when you use a heavy workload in combination with availability groups and after a failover occurs. support.microsoft.com
  9. 9. Fixes an issue in which table and column names that are read from database metadata aren't correctly quoted in some cases when building internal SQL Server batches in stored procedures that manage temporal tables. support.microsoft.com
  10. 10. Fixes the slowness of RESTORE WITH STANDBY operations that you encounter when accelerated database recovery (ADR) isn't enabled. support.microsoft.com
  11. 11. Updates the criterion for determining the current machine type and the judgment conditions of whether it is a domain controller. support.microsoft.com
  12. 12. Adds a validation for the MODEL parameter when running PREDICT to avoid errors due to the input of wrong models. support.microsoft.com
  13. 13. Before the fix, the SQL Server error log records many messages regarding starting or stopping Extended Events (XEvents) sessions. After applying the fix, starting or stopping XEvents sessions isn't logged by default. support.microsoft.com
  14. 14. Adds a new security feature to implement change data capture (CDC) metadata data definition language (DDL) lockdown, preventing errors that might occur when running sp_cdc_vupgrade against a database with CDC disabled. support.microsoft.com
  15. 15. Queries that use the built-in SESSION_CONTEXT function might return incorrect results or trigger access violation (AV) dump files when run in parallel query plans. support.microsoft.com
  16. 16. Enable Trace Flag 12347 - reverts the changes made in fix 2998350. You should remove this trace flag after patching. support.microsoft.com
Checked automatically: 8 of 8 checks passed, 16 quoted passages · compared with Microsoft's page on Oct 20, 2026
  • Quotes found in the official pages: passed
  • Numbers found in the sources: passed
  • Vulnerabilities from the dossier only: passed
  • Links to allowed domains only: passed
  • Every official change covered: passed
  • Readable plain text: passed
  • Changes confirmed by the file list: passed
  • Sources agree: passed

A second AI read the text against the sources: correctness 4/5, clarity 4/5, completeness 5/5. How we work

Published by The Update Bureau. Written with AI from Microsoft's own documents, checked by rules and a second AI. How we work · Report a mistake