KB4052574 - Cumulative Update 2 for SQL Server 2017

Applies to: SQL Server 2017 on Linux (all editions)SQL Server 2017 on Windows (all editions)

This article describes Cumulative Update package 2 (CU2) for SQL Server 2017. This update contains fixes that were released after the initial release of SQL Server 2017 and updates the SQL Server and Analysis services components to the following builds:

Component Build version File version
SQL Server 14.0.3008.27 2017.140.3008.27
Analysis Services 2017.140.1.440


If you use the Query Store feature, do not install this Cumulative Update 2 (CU2) (14.0.3008.27). Instead, install CU3 (14.0.3015.40).

If you have already installed CU2,  after installing CU3 or higher, you must immediately execute the following script to delete all plans collected by Query Store while CU2 was installed:

SET NOCOUNT ON;DROP TABLE IF EXISTS #tmpUserDBs;SELECT [database_id], 0 AS [IsDone]INTO #tmpUserDBsFROM master.sys.databasesWHERE [database_id] > 4AND [state] = 0 -- must be ONLINEAND is_read_only = 0 -- cannot be READ_ONLYAND [database_id] NOT IN (SELECT dr.database_id FROM sys.dm_hadr_database_replica_states dr -- Except all local Always On secondary replicasINNER JOIN sys.dm_hadr_availability_replica_states rs ON dr.group_id = rs.group_idINNER JOIN sys.databases d ON dr.database_id = d.database_idWHERE rs.role = 2 -- Is SecondaryAND dr.is_local = 1AND rs.is_local = 1)DECLARE @userDB sysname;WHILE (SELECT COUNT([database_id]) FROM #tmpUserDBs WHERE [IsDone] = 0) > 0BEGINSELECT TOP 1 @userDB = DB_NAME([database_id]) FROM #tmpUserDBs WHERE [IsDone] = 0-- PRINT 'Working on database ' + @userDBEXEC ('USE [' + @userDB + '];DECLARE @clearPlan bigint, @clearQry bigint;IF EXISTS (SELECT [actual_state] FROM sys.database_query_store_options WHERE [actual_state] IN (1,2))BEGINIF EXISTS (SELECT plan_id FROM sys.query_store_plan WHERE engine_version = ''14.0.3008.27'')BEGINDROP TABLE IF EXISTS #tmpclearPlans;SELECT plan_id, query_id, 0 AS [IsDone]INTO #tmpclearPlansFROM sys.query_store_plan WHERE engine_version = ''14.0.3008.27''WHILE (SELECT COUNT(plan_id) FROM #tmpclearPlans WHERE [IsDone] = 0) > 0BEGINSELECT TOP 1 @clearPlan = plan_id, @clearQry = query_id FROM #tmpclearPlans WHERE [IsDone] = 0EXECUTE sys.sp_query_store_unforce_plan @clearQry, @clearPlan;EXECUTE sys.sp_query_store_remove_plan @clearPlan;UPDATE #tmpclearPlansSET [IsDone] = 1WHERE plan_id = @clearPlan AND query_id = @clearQryEND;PRINT ''- Cleared possibly affected plans in database [' + @userDB + ']''ENDELSEBEGINPRINT ''- No affected plans in database [' + @userDB + ']''ENDENDELSEBEGINPRINT ''- Query Store not enabled in database [' + @userDB + ']''END')UPDATE #tmpUserDBsSET [IsDone] = 1WHERE [database_id] = DB_ID(@userDB)END

Cumulative update

Cumulative updates (CU) are now available at the Microsoft Download Center for Windows.

Only the most recent CU that was released for SQL Server 2017 is available at the Download Center. 

CU packages for Linux are available at https://packages.microsoft.com/.


  • Each new CU contains all the fixes that were included with the previous CU for the installed version of SQL Server.
  • SQL Server CUs are certified to the same levels as Service Packs, and they should be installed at the same level of confidence.
  • Microsoft recommends ongoing, proactive installation of CUs as they become available:
    • Historical data shows that a significant number of support cases involve an issue that has already been addressed in a released CU.
    • CUs may contain added value over and above hotfixes. This includes supportability, manageability, and reliability updates.
  • We recommend that you test CUs before you deploy them to production environments.

How to obtain this CU package for Windows

The following Windows update is available from the Microsoft Download Center:

If the download page does not appear, contact Microsoft Customer Service and Support to obtain the cumulative update package.

Note After future cumulative updates are released for SQL Server 2017, this CU can be located and downloaded from the Microsoft Windows Update Catalog. However, Microsoft recommends that you install the latest cumulative update available.

How to obtain this CU package for Linux

To update Linux to the latest CU, you must first have the cumulative update repository configured. Then, update your SQL Server packages by using the appropriate platform-specific update command.

For installation instructions and direct links to the CU package downloads, see the release notes.

Additional hotfixes that are included in this cumulative update package

Note The following table lists the status of individual Microsoft Knowledge Base articles. A separate Microsoft Knowledge Base article might not be created for each bug.
VSTS bug number KB article number Description Fix area Platform
11076653 4052129

Update for manual change tracking cleanup procedure in SQL Server 2017

SQL Engine All
11076285 4052126 Update adds a new extended event "marked_transaction_latch_trace" in SQL Server 2017 on Linux and Windows SQL Engine All
11123810 4052122 Performance improvement for Spatial Intermediate Filter in SQL Server 2017 SQL Engine All
11129098 4052338 FIX: Excessive PREMPTIVE_OS_CREATEDIRECTORY waits during a workload that compiles or recompiles memory-optimized tables or table-types SQL Engine Linux
11008401 4035062 FIX: Memory use with many databases greater in SQL Server 2016 than earlier versions SQL Engine All
11078705 4039592 FIX: Cannot change the password for a SQL Server 2014 service account when additional LSA protection is enabled Management Tools Windows
11078715 4042232 FIX: Access violation when you cancel a pending query if the missing indexes feature is enabled in SQL Server SQL performance All
11078719 4043947 FIX: Bookmarks functionality does not work completely when you open a report in MHTML format through Outlook in SSRS Reporting Services All
11128807 4052697 FIX: TLS cipher suites with PFS don't work for secure connections in SQL Server 2017 on Linux SQL Engine Linux
11182963 4052969 FIX: Minimum memory limit set to 2GB to install or start SQL Server 2017 SQL Engine Linux
11128694 4052984 FIX: Error when you backup database with memory-optimized tables in SQL Server 2017 In-Memory OLTP All
11183519 4053291 FIX: "sys.dm_exec_query_profiles" DMV returns wrong "estimate_row_count" in SQL Server 2017 on Linux and Windows SQL performance All
11186915 4053329 FIX: Deadlock when multiple PREDICT T-SQL functions run concurrently SQL Engine Windows
11179675 4053349

FIX: "sys.external_libraries" catalog views are empty for non-dbo users in SQL Server

SQL Engine Windows
11179674 4053348 FIX: External R library is installed or uninstalled repeatedly in SQL Server SQL Engine Windows
11192144 4053386 FIX: Using ALTER TABLE on an in-memory optimized table crashes SQL Server 2017 In-Memory OLTP Windows
11188014 4053393 FIX: SQL Server 2017 on Linux does not listen to the nondefault IP address specified by the mssql-conf script SQL Engine Linux
11188013 4053392 FIX: Name resolution error occurs when IPv6 is disabled in SQL Server 2017 on Linux SQL Engine Linux
11133453 4053407 FIX: SQL Server 2017 cannot decrypt data encrypted by earlier versions of SQL Server by using the same symmetric key SQL Engine All
11195748 4053447 FIX: Incorrect warning message that asks to restart SQL Server when it is not required in SQL Server 2017 on Linux Management Tools Linux
11133452 4037454 Policy-Based Management policy not working after you install CU2 for SQL Server 2016 SP1 Management Tools All
11187256 4052625 FIX: Data retrieval queries using non-clustered index seek take much longer in SQL Server SQL Engine Windows
10966006 4037412 FIX: Error 156 when SQL Server replication article contains either GEOGRAPHY_AUTO_GRID or GEOMETRY_AUTO_GRID SQL Engine All
10970440 4042962 FIX: "An unknown error" for "Show More Members" on Entity Dependencies explorer page in SQL Server 2016 Master Data Services Data Quality Services (DQS) All
11003332 4046102 FIX: ForceLastGoodPlan recommendation state is falsely reported as Expired if it is applied manually in SQL Server 2017 SQL Engine All
11078729 4045814 FIX: "Message 611" error when you use BULK INSERT or INSERT SELECT to insert data into a clustered columnstore index SQL Engine Windows
11076441 4046858 FIX: A parallel query execution plan that contains a "merge join" operator takes longer to execute in Cumulative Update 3, 4 or 5 for SQL Server 2016 Service Pack 1 SQL performance All
11057322 4052134 FIX: Errors 33111 and 3013 when you back up a TDE encrypted database in SQL Server SQL Engine All
11195379 4046056 FIX: Assertion occurs on accessing memory-optimized table through MARS SQL Engine Windows
11195380 4054037 FIX: Fatal error when a natively compiled stored procedure is executed to access memory-optimized tables in SQL Server 2017 In-Memory OLTP Windows
11195381 4054035 FIX: Error 213 when you merge or split a partition of a partitioned graph table in SQL Server 2017 on Linux or Windows SQL Engine All
11195382 4054036 FIX: Error 8624 when you execute a query that contains a SELECT DISTINCT statement on a graph column in SQL Server 2017 on Linux or Windows SQL Engine All
11229737 4054842 Improvement: General improvements to the change tracking cleanup process in SQL Server 2017 SQL Engine Windows
11281561 4055758 FIX: Inconsistent behavior for returning trailing blanks at the end of CHAR and BINARY data in SQL Server SQL Engine All

Notes for this update

Hybrid environments deployment

When you deploy the hotfixes to a hybrid environment (such as AlwaysOn, replication, cluster, and mirroring), we recommend that you refer to the following articles before you deploy the hotfixes:

Cumulative update package information


To apply this cumulative update package, you must be running SQL Server 2017.

Restart information

You may have to restart the computer after you apply this cumulative update package.

Registry information

To use one of the hotfixes in this package, you do not have to make any changes to the registry.