sql-server - 在 SQL Server 2019 中运行 Dacpac - 错误 SQL72018:无法导入 SqlTable,但您的源中存在这些对象中的一个或多个
问题描述
我有一个 SQL Server 2008 R2 数据库,我正在针对使用Microsoft.SqlServer.Dac.dll
. 我正在使用 Powershell(在 v5.1 和 v6.x 上尝试过)。当我将相同的 Powershell 脚本指向 SQL Server 2019 时,出现了以下错误:
Exception calling "GenerateDeployReport" with "4" argument(s): "An error occurred during deployment plan generation. Deployment cannot continue
Error SQL72018: SqlTable could not be imported but one or more of these objects exist in your source.
我试过了
- 针对远程和本地 SQL Server 2019 实例运行,该实例在使用同一数据库时不起作用。
- 使用一个表创建一个新的 dacpac 项目,该项目针对同一个 SQL 2019 数据库,但它不起作用。
- 它在一个空数据库上工作
- 在我删除了所有仍然存在的表、存储过程、视图、函数等之后,它在目标数据库上工作。
我正在使用为此构建的 Docker 映像,并且我认为我正在使用最新的 dac 版本,因为我重建了 docker 映像以从 Microsoft 提取最新的 sqlpackage。
解决方案
我升级到了最新版本的 sqlpackage,Microsoft.SqlServer.Dac.dll
它现在可以工作了。它从
# sqlpackage-linux-x64-150.4057.1.zip
RUN curl -Lq https://go.microsoft.com/fwlink/?linkid=873926 -o sqlpackage-linux-x64-latest.zip
至
# Version 18.6, Build 15.0.4897.1
RUN curl -Lq https://go.microsoft.com/fwlink/?linkid=2143497 -o sqlpackage-linux-x64-latest.zip
我以为我的 Docker 构建正在获取最新的 sqlpackage,但事实并非如此。
遗憾的是,微软的例外没有更具描述性。
推荐阅读
- html - Flex Layout 在 reactJs 中没有正确响应
- java - 基本 Java 静态资源问题 - 过去与现在
- jquery - 我无法使用 jquery 访问 $
- python - 我在 Django Heroku 中收到此错误 Application Error 如何解决?
- python - 如何在 DistilBERT 中进行交叉验证
- excel - 组合框未显示添加的项目
- database - Laravel AJAX 调用返回前 1 天的日期
- c++ - 特征等效于 Numpy Brodcasting (3D) 的算术
- r - 设置数组中矩阵的行名
- mongodb - 如何从 mongo express 和 mongo-Compass 连接到使用 Docker compose 创建的 mongoDb 副本