How to remove Alter, Drop, Create SQL from deployment script created in VS 2015 using SSDT 14.06
2
votes
1
answer
1073
views
I need to remove the below auto-generated deployment script for my SQL project. I am using VS 2015 with SSDT 14.06. Would this be something that can be set in the Advanced Deployment settings under the Drop tab ? This is for an existing Database deployment.
IF (DB_ID(N'$(DatabaseName)') IS NOT NULL)
BEGIN
ALTER DATABASE [$(DatabaseName)]
SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
DROP DATABASE [$(DatabaseName)];
END
GO
PRINT N'Creating $(DatabaseName)...'
GO
CREATE DATABASE [$(DatabaseName)]
ON
PRIMARY(NAME = [$(DatabaseName)], FILENAME =
N'$(DefaultDataPath)$(DefaultFilePrefix)_Primary.mdf')
LOG ON (NAME = [$(DatabaseName)_log], FILENAME =
N'$(DefaultLogPath)$(DefaultFilePrefix)_Primary.ldf') COLLATE
SQL_Latin1_General_CP1_CI_AS
GO
USE [$(DatabaseName)];
I have the following items all **unchecked** for my deployment options in the properties:
-- Deploy database properties
-- Always re-create database
-- Block incremental deployment if data loss might occur
-- DROP objects in target but not in project
-- Do not use ALTER ASSEMBLY statements to update CLR types
Asked by Jason
(69 rep)
Aug 28, 2019, 11:57 AM
Last activity: Aug 29, 2019, 02:01 AM
Last activity: Aug 29, 2019, 02:01 AM