首页 > 解决方案 > 在 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.

我试过了

我正在使用为此构建的 Docker 映像,并且我认为我正在使用最新的 dac 版本,因为我重建了 docker 映像以从 Microsoft 提取最新的 sqlpackage。

标签: sql-serversql-server-data-tools

解决方案


我升级到了最新版本的 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,但事实并非如此。

遗憾的是,微软的例外没有更具描述性。


推荐阅读