Disclaimer: There is a similar question on SO that appears to be referring to an older version of SSDT. The selected answer references settings files that are not in my project. I believe I have the equivalent settings in the new project format set correctly.
I'm new to SSDT, and I don't trust it yet to not change my database in unintended ways. After getting the settings the way I wanted, I tried a publish to see what it would try to do to my database. I'm getting these statements added to the publish script:
ALTER DATABASE [$(DatabaseName)]
SET ANSI_NULLS ON,
ANSI_PADDING ON,
ANSI_WARNINGS ON,
ARITHABORT ON,
CONCAT_NULL_YIELDS_NULL ON,
CURSOR_DEFAULT LOCAL,
RECOVERY FULL,
AUTO_UPDATE_STATISTICS ON
WITH ROLLBACK IMMEDIATE;
ALTER DATABASE [$(DatabaseName)]
SET PAGE_VERIFY NONE
WITH ROLLBACK IMMEDIATE;
EXECUTE sp_executesql N'ALTER DATABASE [$(DatabaseName)]
SET TRUSTWORTHY OFF
WITH ROLLBACK IMMEDIATE';
I don't want the database project to ever modify my database settings, so I have this unchecked under Debug settings:
Also, here under advanced publish settings:
Under Project Settings | Database Settings I made everything match my database:
How can I prevent this?
There are two checkboxes that have to be unchecked prior to saving the publish profile. Make sure you go to project properties --> Debug and uncheck "Deploy database properties"
then right click on your database project --> publish then click "Advanced" to uncheck "Deploy database properties"
Click OK, Click Save Profile As, and from now on, every time you deploy your generated script using the publish profile you've just created, will only contain the modifications you want.
I'm using VS 2013 with the latest SSDT as of 20-Apr-2016.
My solution was to carefully verify that all settings were a perfect match. I had assumed that since I had set some of the settings to be the same, that those settings would no longer be in the generated change script. This is not the case, however. If there are any database setting differences, it appears to include others that ARE the same with the wrong value.
The settings I had missed were on the 2nd and 3rd tabs of the Database Settings dialog (Operational and Miscellaneous).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With