如何停止数据库部署以删除服务器触发器?

时间:2023-01-13 13:27:18

I am deploying my database using a Visual-Studio database project and the Publish wizzard.

我正在使用visualstudio数据库项目和发布wizzard部署我的数据库。

The initial deploy works fine and my database is the same as my project. I then apply a third party tool to my database which adds triggers to all my tables.

初始部署工作良好,我的数据库与我的项目相同。然后,我将一个第三方工具应用到数据库中,该工具将触发器添加到所有表中。

I then deploy an update to my database and it removes the third party triggers from my database.

然后,我将更新部署到数据库,它将从数据库中删除第三方触发器。

how do I stop my deploy from removing triggers that are on the server but not in the project?

如何阻止我的部署移除服务器上但不在项目中的触发器?

I have tried unticking "Drop DML triggers not in source" in the Advance Deployment Settings but this has not worked.

我尝试过在预先部署设置中“删除DML触发器”,但这并没有起作用。

如何停止数据库部署以删除服务器触发器?

Anyone else have any ideas?

还有人知道吗?

PS: I am using Visual studio 2015

PS:我使用的是Visual studio 2015

The rest of my deployment settings are as follows: 如何停止数据库部署以删除服务器触发器? 如何停止数据库部署以删除服务器触发器? 如何停止数据库部署以删除服务器触发器?

我的其他部署设置如下:

1 个解决方案

#1


2  

So I found the problem.

所以我找到了问题所在。

When I was setting my Advanced Deployment Properties I was doing it by:

当我在设置高级部署属性时,我是这样做的:

  1. Right Clicking Database - Properties
  2. 右键单击数据库-属性
  3. Going to debug tab (there is no Deploy tab in 2015 like the documentation mentions)
  4. 进入debug选项卡(2015年没有部署选项卡,如文档中提到的)
  5. Changing my Deployment Options here using "Advanced" button at the bottom.
  6. 使用底部的“高级”按钮更改这里的部署选项。

I then realised that when I clicked Publish on my project there was an Advanced button on here.

然后我意识到,当我点击我的项目上的发布时,这里有一个高级按钮。

Clicking the Advanced button on the Publish dialog showed different options to what I was getting on the projects properties.

单击发布对话框上的高级按钮,会显示不同的选项,以了解我在projects属性上获得了什么。

I removed the Drop DML Triggers check from this screen and it worked

我从屏幕上删除掉了DML触发器,它起作用了。

In addition to this. I then clicked Save Profile and added it to my project using Add Existing Item I then used this answer to set this profile as my default publishing profile

除了这个。然后单击Save Profile并使用Add Existing Item将其添加到项目中,然后使用此答案将此概要设置为默认发布概要

#1


2  

So I found the problem.

所以我找到了问题所在。

When I was setting my Advanced Deployment Properties I was doing it by:

当我在设置高级部署属性时,我是这样做的:

  1. Right Clicking Database - Properties
  2. 右键单击数据库-属性
  3. Going to debug tab (there is no Deploy tab in 2015 like the documentation mentions)
  4. 进入debug选项卡(2015年没有部署选项卡,如文档中提到的)
  5. Changing my Deployment Options here using "Advanced" button at the bottom.
  6. 使用底部的“高级”按钮更改这里的部署选项。

I then realised that when I clicked Publish on my project there was an Advanced button on here.

然后我意识到,当我点击我的项目上的发布时,这里有一个高级按钮。

Clicking the Advanced button on the Publish dialog showed different options to what I was getting on the projects properties.

单击发布对话框上的高级按钮,会显示不同的选项,以了解我在projects属性上获得了什么。

I removed the Drop DML Triggers check from this screen and it worked

我从屏幕上删除掉了DML触发器,它起作用了。

In addition to this. I then clicked Save Profile and added it to my project using Add Existing Item I then used this answer to set this profile as my default publishing profile

除了这个。然后单击Save Profile并使用Add Existing Item将其添加到项目中,然后使用此答案将此概要设置为默认发布概要