dacpac

How to avoid data loss with EF Model First database schema upgrade?

Deadly 提交于 2019-12-12 08:38:33
问题 This is a long question, but I would be very very thankful if I can get some good advice on this. In short, I’m looking for a good approach for version upgrade of MS SQL database schema that also demands data being moved from deleted tables into new tables. I think Stack Overflow is the most appropriate place for this question (not dba.stackexchange.com) because at its core, this is an issue for .NET developers using Entity Framework, and the database parts of this consists mostly of auto

Error SQL72018: Database Options could not be imported

冷暖自知 提交于 2019-12-12 01:39:25
问题 I am deploying an MVC Project along with a database using Octopus. When the step for deploying the database is hit I'm getting the following error: An error occurred during deployment plan generation. Deployment cannot continue. Error SQL72018: Database Options could not be imported but one or more of these objects exist in your source. at Microsoft.SqlServer.Dac.DacServices.CreateController(SqlDeployment deploymentEngine, ErrorManager errorManager) at Microsoft.SqlServer.Dac.DeployOperation.

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

How do I reach out to a DACPAC project references through DAC api?

夙愿已清 提交于 2019-12-11 22:59:53
问题 I'm trying to use GetObject method to obtain an instance of a TSqlObject representing a table from a referenced project: var id = new ObjectIdentifier(new[] {"ExternalDb"}, new[] {"Schema", "TableName"}); var table = Model.GetObject(ModelSchema.Table, id, DacQueryScopes.All); Unfortunately that doesn't seem to work. I've read inside the doc that DacQueryScopes.All will get all objects, EXCEPT those in a non-system db. So I guess this is why this fails, but then how am I supposed to reach up

Deploying SSDT project through Powershell Script: Version store out of memory error

我的梦境 提交于 2019-12-11 06:07:13
问题 Hoping someone may be able to advise what might be happening here. I am attempting to run an SSDT deployment via a Powershell script directly on the SQL Server its-self. SQL Version: 2012 (upgrade not possible at the moment) Exact error: System.Management.Automation.MethodInvocationException: Exception calling "GenerateDeployScript" with "3" argument(s): "Version store out of memory (cleanup already attempted)" Microsoft.Isam.Esent.Interop.EsentVersionStoreOutOfMemoryException: Version store

Get DataType of computed column from dacpac

╄→尐↘猪︶ㄣ 提交于 2019-12-11 03:57:21
问题 When traversing a Dacpac via C# code, I am able to figure out which columns are referenced in a computed column ( GetReferenced(Microsoft.SqlServer.Dac.Model.Column.ExpressionDependencies) ), and what the expression for the column is ( Microsoft.SqlServer.Dac.Model.Column.Expression property). What I cannot find, is the datatype of the computed column. Besides that, I also cannot find a way to retrieve the columns of a FileTable table (although this is a static set of columns). Search engines

User Created Using DACPAC Cannot Log On

核能气质少年 提交于 2019-12-11 03:16:35
问题 I have a Visual Studio 2013 SQL Database Project which creates a DACPAC file for deployment of the SQL database to SQL Server using the "Deploy Data-tier Application..." option is SQL Server Management Studio (SSMS). As part of the project, there is a Security folder with an SQL script in it that creates the required user. The script is: CREATE LOGIN [MyLogin] WITH PASSWORD = N'MyPassword', DEFAULT_DATABASE = [MyDatabase], DEFAULT_LANGUAGE = [us_english], CHECK_EXPIRATION = OFF, CHECK_POLICY

How to check whether database user already exists in Azure SQL Database

好久不见. 提交于 2019-12-11 02:05:47
问题 My new client is planning to use Azure managed SQL Database services. I am using dacpac in order to deploy the database. In the dacpac, I have a post-deployment script in order to create a sql user as follows IF NOT EXISTS (SELECT name FROM sys.server_principals WHERE name = 'myusername') BEGIN CREATE LOGIN myusername WITH PASSWORD = '******'; END GO However, it is throwing the following error when I try to apply dacpac in Azure (which is compiled with target platform - Microsoft Azure SQL

How to update an SSDT project from the command line?

房东的猫 提交于 2019-12-10 18:51:00
问题 I hope to be able to use SSDT (SQL Server Data Tools) to put our database schema under version control. Importing a database into an SSDT project in Visual Studio creates a nice textual representation of the database schema, suitable for versioning. Now, the question is, when changes are made to the database schema - how can we programmatically, or from the command line, update (or re-import) the SSDT project? 回答1: You can use the built-in schema compare tool to do this, but it seems that you

How not to include sql file content when publishing?

﹥>﹥吖頭↗ 提交于 2019-12-09 06:43:29
I have a question that is very similar to an older question of mine Using variable in sql postdeployment build script? But now I don´t want to do an if/else and have the sql code in my published script. I don´t want to share information beetween customers. So... here goes I have a database project in Visual Studio. I also have 2 customers with different needs I know I can use post.deployment script to include content of sql files I need by setting a varible in Project.Properties."SQLCMD Variables". And then use it like this in Script.PostDeployment.sql :r ..\$(Customer)Setup.sql Where I have 2