首页 > 解决方案 > 修补 SQL Server LocalDB

问题描述

我安装了 SQL Server 2017 LocalDb (v14.0.1000.169)。我想以无人值守的方式使用最新的 CU 修补此安装。

但是,当我从 SQLServer2017-KB4508218-x64 运行 setup.exe 时,它​​说我没有安装合适的版本。

C:\test\extracted>setup.exe /action=patch /allinstances /quiet /IAcceptSQLServerLicenseTerms
Microsoft (R) SQL Server 2017 14.00.3223.03
Copyright (c) 2017 Microsoft.  All rights reserved.

No features were updated during the setup execution. The requested features may not be installed or features are already at a higher patch level. Please review the summary.txt logs for further details.
The version of SQL Server instance Shared Component does not match the version expected by the SQL Server update. The installed SQL Server product version is 13.1.4414.46, and the expected SQL Server version is 14.0.1000.169.

但我肯定安装了该版本的 localdb:

C:\test\extracted>sqllocaldb versions 
Microsoft SQL Server 2017 (14.0.1000.169)

我在这里做错了什么?还有另一种更新LocalDB的方法吗?由于此版本的 LocalDB 存在一个已知问题,我需要这样做。

以交互方式运行安装程序没有帮助 - 给出相同的消息。

标签: sql-serverlocaldb

解决方案


看来,如果您只使用 sqllocaldb.msi 安装 localdb,CU 安装程序将永远无法修补您的 localdb 实例。这似乎是一个长期存在的错误:

https://sqlblog.org/2012/09/06/sqllocaldb-vs-cumulative-updates

由于 Microsoft 没有提供超出 RTM 版本的更新 sqllocaldb.msi,因此您必须使用Express 版的完整安装程序,然后使用 CU 安装程序应用 CU。

这成功地检测到了 localdb(连同我被迫安装的 Express 实例)并修补了两者。


推荐阅读