JKennedy
JKennedy

Reputation: 18827

How do I stop Database deploy from removing Server Triggers?

I am deploying my database using a Visual-Studio database project and the Publish 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.

enter image description here

Anyone else have any ideas?

PS: I am using Visual studio 2015

The rest of my deployment settings are as follows: enter image description here enter image description here enter image description here

Upvotes: 1

Views: 411

Answers (1)

JKennedy
JKennedy

Reputation: 18827

So I found the problem.

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

  1. Right Clicking Database - Properties
  2. Going to debug tab (there is no Deploy tab in 2015 like the documentation mentions)
  3. Changing my Deployment Options here using "Advanced" button at the bottom.

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.

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

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

Upvotes: 3

Related Questions