SSDT如何:部署.dacpac忽略目标上的删除列 [英] SSDT How to: Deploy .dacpac ignoring drop columns on target
问题描述
我在Visual Studio中使用数据库项目。
在我的方案中,我有客户直观地定制我为他们提供的数据库。在现有表中添加一些列,添加新表...
如何在部署.dacpac时不会排除不属于我的模式的这些对象?
重要提示:
设置DropObjectsNotInSource = FALSE不适用于表格列。
EDIT
Ed,请查看我是否做错了: / p>
using(DacPackage dacPackage = DacPackage.Load(DacPacFileName))
{
var dacServices = new DacServices ConnectionString);
var dacOptions = new DacDeployOptions
{
AdditionalDeploymentContributorArguments =SqlPackageFilter = KeepTableColumns(*)
};
dacServices.Deploy(dacPackage,NomeBancoDados,true,dacOptions);
}
在表过滤器ALL TABLES中是*吗?
我尝试了一个表名,但它不工作。
为此场景写下:
https://agilesqlclub.codeplex。 com
您可以Keep部署对象,如果它们不存在,但不部署,如果有更改或忽略完全忽略。 / p>
您可以在类型或名称(regex)上执行此操作
Ed
I'm using the Database project in Visual Studio.
In my scenario I have customers who intuitively customize the database I provide for them, e.g. adding some columns in existing tables, adding new tables...
How can I make when deploying .dacpac these objects that are not part of my schema are not excluded?
Important:
Set DropObjectsNotInSource=FALSE is not working for table columns.
EDIT
Ed, please see if I am doing something wrong:
using (DacPackage dacPackage = DacPackage.Load(DacPacFileName))
{
var dacServices = new DacServices(ConnectionString);
var dacOptions = new DacDeployOptions
{
AdditionalDeploymentContributorArguments = "SqlPackageFilter=KeepTableColumns(*)"
};
dacServices.Deploy(dacPackage, NomeBancoDados, true, dacOptions);
}
Is '*' in table filter "ALL TABLES" ?
I tried a table name too, but it did not work.
I wrote this for this scenario:
https://agilesqlclub.codeplex.com
You can "Keep" which deploys objects if they do not exist but does not deploy if there are changes or "Ignore" to completely ignore.
You can do this on type or name (regex)
Ed
这篇关于SSDT如何:部署.dacpac忽略目标上的删除列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!