dacpac

How not to include sql file content when publishing?

匆匆过客 提交于 2019-12-08 05:57:12
问题 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

How to disable predeployment and postdeployment scripts in DacServices.Deploy()

天涯浪子 提交于 2019-12-08 03:39:57
问题 We have some automated dacpac deployment code which correctly handles both a CreateNewDatabase and straightforward Update database scenarios in C# using Microsoft.SqlServer.Dac Now in the CreateNewDatabase case we want to be able to run the DacServices.Deploy() with both the Pre and Post Deployment scripts disabled. I.e. they should not be executed in this scenario. I have tried to find a suitable place in the DacDeployOptions and DacServices objects but cannot find anything that will do this

How to disable predeployment and postdeployment scripts in DacServices.Deploy()

馋奶兔 提交于 2019-12-06 04:57:59
We have some automated dacpac deployment code which correctly handles both a CreateNewDatabase and straightforward Update database scenarios in C# using Microsoft.SqlServer.Dac Now in the CreateNewDatabase case we want to be able to run the DacServices.Deploy() with both the Pre and Post Deployment scripts disabled. I.e. they should not be executed in this scenario. I have tried to find a suitable place in the DacDeployOptions and DacServices objects but cannot find anything that will do this.Ideally Question 1 : I would like something like DacDeployOptions.IgnorePreDeploymentScript = true Is

VSTS build doesn't pickup the dacpac file (hosted agent in cloud)

a 夏天 提交于 2019-12-06 03:37:01
I'm trying to use VSTS to deploy into my database, the problem is in one of the steps I need to pick up the dacpac file and deploy it to the Azure SQL server but it fails: in that step, I'm using " Execute Azure SQL: DacpacTask " which is provided by Microsoft in VSTS. there is a filed to do it which is called " DACPAC File " and the documentation said to use it like this: $(agent.releaseDirectory)\AdventureWorksLT.dacpac but it gave me the below error: No files were found to deploy with search pattern d:\a\1\s\$(agent.releaseDirectory)\AdventureWorksLT.dacpac so I did a cheating and put the

DACPAC not including composite objects

白昼怎懂夜的黑 提交于 2019-12-04 16:16:33
I have a VS2012 database project which includes tables, stored procs, views etc. I then have a second database project which contains a database reference to the first project. I have ensured that the "Include composite objects" options is selected from the "Project Properties -> Debug -> Advanced" menu. When I build the second project and take the resulting DACPAC file and deploy it through SSMS2012 it doesn't create the firsts project's objects. Am I missing something? Why don't the composite objects get included in the DACPAC? SmudgerDan As Peter Schott said in the comments above, I needed

DacFx DeploymentPlanExecutor OnExecute not called

点点圈 提交于 2019-12-04 04:59:37
问题 I'm trying to program a custom DeploymentPlanExecutor using Microsofts DacFx 3.0 but the OnExecute -Method is never called. If I use an identical DeploymentPlanModifier instead, OnExecute() is called as expected. No matter whether I add the Executor, the Modifier, or both, the DAC actually is successfully deployed to the Database. The Executor seems to be recognized during the Deployment since OnApplyDeploymentConfiguration() is called Unfortunately I wasn't able to find any examples that use

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

二次信任 提交于 2019-12-04 04:54:30
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-generated sql scripts. Background A .NET application and SQL database is running in Azure (The application

How to capture DacSevices.Deploy output?

允我心安 提交于 2019-12-03 09:49:46
问题 So I've managed to deploy our DACPAC schema via Octopus. I'm using a Deploy.ps1 script interacting with .Net objects just like the article describes. I'd like to make the deployment process more transparent by including the "standard output" you get from sqlcmd in our Octopus logs. I'm looking for the the generated schema modification messages as well as any custom migration migration messages our developers have put into the pre/post scripts. The only workaround I can think of is to first

How to capture DacSevices.Deploy output?

断了今生、忘了曾经 提交于 2019-12-03 00:31:46
So I've managed to deploy our DACPAC schema via Octopus . I'm using a Deploy.ps1 script interacting with .Net objects just like the article describes. I'd like to make the deployment process more transparent by including the "standard output" you get from sqlcmd in our Octopus logs. I'm looking for the the generated schema modification messages as well as any custom migration migration messages our developers have put into the pre/post scripts. The only workaround I can think of is to first generate the script with the DACPAC services and then run it with sqlcmd.exe. Any ideas? Found the

DacFx DeploymentPlanExecutor OnExecute not called

独自空忆成欢 提交于 2019-12-02 03:21:02
I'm trying to program a custom DeploymentPlanExecutor using Microsofts DacFx 3.0 but the OnExecute -Method is never called. If I use an identical DeploymentPlanModifier instead, OnExecute() is called as expected. No matter whether I add the Executor, the Modifier, or both, the DAC actually is successfully deployed to the Database. The Executor seems to be recognized during the Deployment since OnApplyDeploymentConfiguration() is called Unfortunately I wasn't able to find any examples that use an DeploymentPlanExecutor (only examples with DeploymentPlanModifier ) and the documentation of DacFx