1

我正在尝试使用 SQL Server 数据库部署发布任务来部署我的 dacpac,我想使用 /p:DoNotDropObjectTypes=Users;Permissions 参数来防止某些对象被删除,但是我在下面收到以下错误:

2018-08-13T15:48:30.2644849Z ##[section]Starting: Deploy using : dacpac
2018-08-13T15:48:30.2655188Z ==============================================================================
2018-08-13T15:48:30.2655399Z Task         : SQL Server Database Deploy
2018-08-13T15:48:30.2655603Z Description  : Deploy to SQL Server Database using DACPAC or SQL scripts
2018-08-13T15:48:30.2655749Z Version      : 0.3.11
2018-08-13T15:48:30.2655878Z Author       : Microsoft Corporation
2018-08-13T15:48:30.2656030Z Help         : [More Information](https://aka.ms/sqldacpacmachinegroupreadme)
2018-08-13T15:48:30.2656531Z ==============================================================================
2018-08-13T15:48:36.9603826Z *** 'DoNotDropObjectTypes' is not a valid argument for the 'Publish' action.
2018-08-13T15:48:37.2122455Z ##[error]System.Management.Automation.RuntimeException
2018-08-13T15:48:37.2249276Z ##[section]Finishing: Deploy using : dacpac

我还尝试使用我的发布配置文件 sans 在任务中设置其他参数:

<DropObjectsNotInSource>True</DropObjectsNotInSource>
<DoNotDropPermissions>True</DoNotDropPermissions>
<DoNotDropRoleMembership>True</DoNotDropRoleMembership>
<DoNotDropUsers>True</DoNotDropUsers>

但 SqlPackage 无论如何都试图删除它们:

Dropping Permission... Dropping Permission... Dropping Permission... Dropping Permission... Dropping Permission... Dropping Permission... Dropping Permission... 
4

1 回答 1

0

我认为 SQL Server Data Tools 需要安装在您的代理运行的位置。查看这篇 MSDN 文章这篇博文。

于 2018-08-23T08:03:26.023 回答