sqlpackage

Deploy SQL Server database project (SSDT) via command line

半城伤御伤魂 提交于 2019-12-17 15:41:52
问题 I have a SQL Server Database Project targeting a SQL Server 2012 RC0 database. The project was created in Visual Studio 2010 + SQL Server Data Tools CTP4. The project type is different than the regular Visual Studio 2010 database projects (it's the next version of SQL Developer Tools CTP3 Juneau). It deploys fine in the IDE. How can I deploy it via the command line? I tried VSDBCMD.exe but it expects a .deploymanifest file which is not created by the new project type. 回答1: Use sqlpackage.exe

SSDT/SqlPackage drops statistics

此生再无相见时 提交于 2019-12-13 07:48:17
问题 During build we generate dacpac files of our database based on a SSDT .sqlproject. This dacpac later gets deployed to production using sqlpackage. Despite using the /p:DropStatisticsNotInSource=False switch, sqlpackage will drop all statistics, that were added after the last sync of the sqlproject with the production database. We can also reproduce this using a publish profile and the generate script option of SSDT: <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="14.0" xmlns=

sqlpackage breaks when trying to alter a FILESTREAM column

南笙酒味 提交于 2019-12-13 01:51:50
问题 I have a SQL Database project, where I have recently amended a FILESTREAM column to allow nulls. I am trying to publish the project's dacpac to a db where the column already exists, as a filestream column, but is currently NOT NULL . I am performing the publish using the sqlpackage.exe command line tool (version 12.0.2882.1). However, it produces the error: Error SQL72014: .Net SqlClient Data Provider: Msg 4990, Level 16, State 1, Line 1 Cannot alter column 'document' in table 'Document' to

Overriding DefaultDataPath and DefaultLogPath variables when using SqlPackage to publishing a dacpac

半腔热情 提交于 2019-12-12 12:29:29
问题 The environment: Using a SQL Server Database Tool in Visual Studio 2013, Update 4 to create a DacPac for publishing a database. Using TFS build to build and drop the database project. Using SqlPackage version to publish the dacpac to SQL Server 2012. Using the SqlPackage Action "Publish", the script for deployment is generated using the following variables based on the target database's defaults : :setvar DefaultDataPath "H:\YourServerDefault" :setvar DefaultLogPath "H:\YourServerDefault" I

Publishing DacPacs in Visual Studio 2013

蹲街弑〆低调 提交于 2019-12-12 01:23:38
问题 I have an SSDT database project in Visual Studio 2013. This is used as the "answer sheet" when publishing database updates to a database in the other environments. I recently came across Jamie Thompson's blog article on DacPacs, where he writes a great summary on what DacPacs are, and how to use them. Now, say I have the following scenario: The SSDT project in VS2013, which is version 1.0.33 A database in my Dev environment, which is version 1.0.32 A database in my S-test environment, whic is

SQLPackage Post Deployment Script not running

霸气de小男生 提交于 2019-12-11 10:38:07
问题 I'm using Visual Studio 2013 with TFS, over SQL-Server 2012. Specifically I'm using SQL-Server Data Tools within VS for our SQL development, rather than within SQL-Server Management Studio. In short, the Post-Deployment SQL script appears not to be executed by SQLPackage. The specifics are: I have a VS SQL Database Project 'ADMIR', which has been developing over the last few weeks and gradually becoming more sophisticated both in terms of SQL and it's deployment. The database includes some

Is there any way to stop SqlPackage.exe setting default Filegroup in deployment script?

让人想犯罪 __ 提交于 2019-12-05 04:58:07
We are using Sql Server database projects to create deployment scripts from DacPac using SqlPackage.exe. We have different SQL Server Filegroups setup in various environments. When deploying we exclude Filegroups as we want objects to create in the default Filegroup. In database project settings the default Filegroup is not changed from PRIMARY. This presents a problem when attempting to deploy to an environment where the default Filegroup is not PRIMARY because the following code is included... ALTER DATABASE [$(DatabaseName)] MODIFY FILEGROUP [PRIMARY] DEFAULT; Is there a way to prevent this

Deploy SQL Server database project (SSDT) via command line

久未见 提交于 2019-11-27 19:33:05
I have a SQL Server Database Project targeting a SQL Server 2012 RC0 database. The project was created in Visual Studio 2010 + SQL Server Data Tools CTP4. The project type is different than the regular Visual Studio 2010 database projects (it's the next version of SQL Developer Tools CTP3 Juneau). It deploys fine in the IDE. How can I deploy it via the command line? I tried VSDBCMD.exe but it expects a .deploymanifest file which is not created by the new project type. Keith Use sqlpackage.exe , located in C:\Program Files\Microsoft SQL Server\{version}\DAC\bin or C:\Program Files (x86)

Publish DACPAC to SQL Server 2014 using SqlPackage.exe?

前提是你 提交于 2019-11-27 18:22:26
I've been successfully publishing DACPACs to SQL Server 2008-2012 instances using SqlPackage.exe, as installed by SQL Server Data Tools (and typically found in C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin ). However, in attempting to publish a 2014-targeted DACPAC to a SQL Server 2014 instance using this same SqlPackage.exe, I get the following: *** Could not deploy package. Internal Error. The database platform service with type Microsoft.Data.Tools. Schema.Sql.Sql120DatabaseSchemaProvider is not valid. You must make sure the service is loaded, or you must provide the full type

Publish DACPAC to SQL Server 2014 using SqlPackage.exe?

对着背影说爱祢 提交于 2019-11-26 19:23:13
问题 I've been successfully publishing DACPACs to SQL Server 2008-2012 instances using SqlPackage.exe, as installed by SQL Server Data Tools (and typically found in C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin ). However, in attempting to publish a 2014-targeted DACPAC to a SQL Server 2014 instance using this same SqlPackage.exe, I get the following: *** Could not deploy package. Internal Error. The database platform service with type Microsoft.Data.Tools. Schema.Sql