database-project

VS 2013 Database Project: Post-Deployment scripts to run based off of build configuration

扶醉桌前 提交于 2019-12-10 17:22:36
问题 Is there a method/ mechanism available to run a different set of post-deployment scripts in the SSDT-based database project in Visual Studio 2012/ 2013, based off of the build configuration? I would like to pre-populate my data for testing/ continuous integration by deploying with a "Testing" configuration, but naturally don't want to do this for other environments. I can't seem to find a way to conditionally link a post-deployment script to a build configuration, though, and that seems

Sql Server Database Projects - missing template in VS 2013

懵懂的女人 提交于 2019-12-10 16:50:00
问题 In VS2012 I used Sql Server Datbase Projects to manage my databases. I have tried to add a Db Project to a new VS2013 solution but I can't seem to find the template. I've looked online and in the installed templates. Any ideas? 回答1: To me, it is listed under "Other Languages". I have VS 2013 professional 回答2: VS2013 lists "SQL Server" after the "Visual F#" option in the "New Project" window. Clicking on this "SQL Server" option shows one template called "SQL Server Database Project". Perhaps

database Project not running Post Deployment scripts

巧了我就是萌 提交于 2019-12-10 15:59:43
问题 We have a solution with three database projects. All three produced dacpacs are deployed sequentially but for some reason, one of these dacpacs does not run the post-deployment script. We're using sqlpackage to create a diffscript, and the diffscript does correctly include the post-deployment statements.. here's a snippet IF EXISTS (SELECT * FROM #tmpErrors) ROLLBACK TRANSACTION GO IF @@TRANCOUNT>0 BEGIN PRINT N'The transacted portion of the database update succeeded.' COMMIT TRANSACTION END

Reference Class Library in Sql Server Clr Project

纵然是瞬间 提交于 2019-12-10 13:56:32
问题 I am trying to reference a class library from a Visual C# SQL CLR Database Project but I get the error A reference to 'class library' could not be added. SQL Server projects can reference only other SQL Server projects. Is there a way to add the reference so I don't need to duplicate the code in that class library? EDIT - Solution? My current solution, is just adding the few required class files to the SQL CLR Database Project as links to the real files. That way code is in one place, even

Allow (once) column drop in database project

感情迁移 提交于 2019-12-09 17:54:14
问题 I would like to drop one column in existing table. When I simply remove it from table's create script it will cause error (data loss...) on deployment. I would like to allow (in this case) column drop. How you would do that? 回答1: To disable the data loss error: Click the Options icon in your schema comparison file. Uncheck "Block on possible data loss". The setting will change for just that 1 schema comparison and it will be saved within the schema comparison file. If you only want to do this

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

How to handle users and logins in Visual Studio Database Project?

偶尔善良 提交于 2019-12-09 03:03:55
问题 I've built a database in SQL Server 2008 R2 and am using Visual Studio 2010 Ultimate to create a database project for it. I've created both a SQL Server project and Database project to represent my environment based on this MSDN walkthrough. The schema comparisons for both projects work as expected and I'm able to replicate all changes server to project. However, it seems to have imported some environment specific configuration, such as logins, user/login mapping, local service accounts (e.g.

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

VS2010 Database project deploy - “SqlDeployTask” task failed unexpectedly, NullReferenceException

℡╲_俬逩灬. 提交于 2019-12-07 13:17:28
I have a solution in Visual Studio 2010 with a number of SQL Server 2008 database projects. I'm trying to do a 'Deploy Solution' and I'm getting the following error for one of the database pojects: ------ Deploy started: Project: MyDBProj, Configuration: Sandbox Any CPU ------ C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\TeamData\Microsoft.Data.Schema.TSqlTasks.targets(120,5): Error MSB4018: The "SqlDeployTask" task failed unexpectedly. System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Data.Schema.Sql.SchemaModel.SqlModelComparerBase

Do I need the .dat file when I place a visual studio database project under version-control

浪尽此生 提交于 2019-12-07 08:20:18
问题 I have a visual studio 2008 database project that is under version control (git). I am getting conflicts in the project_name.dat when I try to merge my branches. So my questions ares: What is the project_name.dat file? Do I need it? That is can I leave it out of my version control 回答1: No , you shouldn't have it under sourcecontrol as it's autogenerated. 回答2: Offtopic but maybe useful: You should configure your VCS so that special files and folders will be ignored during your commit. I use