1

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

JKennedy
  • 18,150
  • 17
  • 114
  • 198
  • Does the second deploy recreate the tables? – DavidG Oct 28 '15 at 11:35
  • Also, I see a checkbox in the picture called "Do not drop database triggers", have you tried checking that? – DavidG Oct 28 '15 at 11:37
  • @DavidG I will double check now if it re-creates tables. For some reason I cannot check any of those properties in the grey table – JKennedy Oct 28 '15 at 11:39
  • Or perhaps you have "always re-create database" checked? – DavidG Oct 28 '15 at 11:47
  • @DavidG I have checked deployment options and don't have `always re-create database` checked. The tables aren't being re-creeate in between deploys. I will add screenshots of all my deployment settings – JKennedy Oct 28 '15 at 11:59
  • 1
    @DavidG I found the problem. `Deployment options` in the project properties did not tally up with the `Publish` dialog `Deployment Options`. Could be a bug in 2015? Could be me being stupid – JKennedy Oct 28 '15 at 12:29

1 Answers1

3

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

Community
  • 1
  • 1
JKennedy
  • 18,150
  • 17
  • 114
  • 198