database-project

SQL Database Project: build different scripts depending on build configuration

我怕爱的太早我们不能终老 提交于 2019-12-18 16:58:39
问题 The problem I want to solve is to build different scripts depending on build configuration. Say we have two instances of SQL Server: Enterprise version with connected Linked servers LocalDb version for offline developing and unit tests Enterprise version has views for Linked servers when LocalDB substitues those views with local tables. Those Linked Server views and local tables have the same names and set of fields. So they are not included in build by default (Build Action = None). Instead

Update target button is disabled after schema comparison

两盒软妹~` 提交于 2019-12-17 18:46:24
问题 I have created database project using VS 2012. Once the schema comparison is done, the update target button should be enabled to sync with target. But it's not getting enabled. Any help plz. I'm using VS 2012 with sp 3, SQL Server 2012, 回答1: Check in Error List if you have any error, I have a non recognized word in VS (but it does in SQL Server), I commented it out, re-compared and it was enabled successfully. 回答2: See if you have a "warning" message stating "Cannot generate deployment plan

What is the function of the DBMDL File in VS database project

南笙酒味 提交于 2019-12-17 17:54:29
问题 What is the function of the DBMDL file in a visual studio database project? 回答1: From what I can make out, it is a serialized file of your db model and is used as a cache for improving the performance of deployment. It is unique per user thus should not be checked into source control. 来源: https://stackoverflow.com/questions/3634649/what-is-the-function-of-the-dbmdl-file-in-vs-database-project

'Incorrect SET Options' Error When Building Database Project

左心房为你撑大大i 提交于 2019-12-17 10:52:15
问题 We are using Visual Studio and a database project to generate our database. I just made a number of database changes (including adding a new table named Correspondence ) imported those changes into the database project, and attempted to deploy (rebuild) the database. When I do, I get the following error: Creating [dbo].[Correspondence]... Msg 1934, Level 16, State 1, Server (Server Name), Line 1 CREATE TABLE failed because the following SET options have incorrect settings : 'ANSI_WARNINGS,

VS 2008 Database Project - During Deploy 'DatabaseName' undefined

老子叫甜甜 提交于 2019-12-13 02:43:55
问题 I am using VS 2008 and have inhertied a database project that I am trying to deploy. The deploy I am doing is to a new database. (as if I were setting up a new installation) The Deploy Action is: Create Scrip and deploy to Database. I get the following error: Schema.dbschema(0,0)Error TSD01268: SQL Execution error: A fatal error occurred. The variable DatabaseName could not be found. The DatabaseName is defined in the project properties. If I look a the deployment script I see the declaration

MSBuild & SQL Server Database Project: bind the deploy and publish desination to the build configuration

…衆ロ難τιáo~ 提交于 2019-12-12 22:13:32
问题 Visual Studio 2012. SQL Server Database Project. Four build configurations were created in solution: Debug, DevDb, TestDb, LocalDb. Three publish profiles were created in project: DevDb.publish.xml, TestDb.publish.xml, LocalDb.publish.xml Pushing F5 button (!) I want to: deploy project with connection string from project properties if build configuration is Debug . publish project with connection string from the corresponding publish profiles if build configuration is DevDb , TestDb or

Database Project, Assembly was not found in the SQL catalog

♀尐吖头ヾ 提交于 2019-12-12 21:36:41
问题 I have a SQL Server Database project in Visual Studio 2013. This project refer to another project called BusinessLayer . BusinessLayer project has reference to System.Component.DataAnnotations and DataAnnotations is in .NET framework dll folder "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.ComponentModel.DataAnnotations.dll" I also write a SQL CLR Trigger in DB Project, and when I deploy the database project, I got this error: SQL72014: .Net

Powershell File Watcher Not Picking Up File Changes Made in Visual Studio

只愿长相守 提交于 2019-12-11 11:51:50
问题 I have a powershell process that watches for SQL files (in a database project), and then triggers an action when a file changes. The basic setup is below. $global:SQLFileWatcher = New-Object IO.FileSystemWatcher $rootFolder, $sqlFilter -Property @{ IncludeSubdirectories = $true NotifyFilter = [IO.NotifyFilters]'LastWrite' } $onSqlCreated = Register-ObjectEvent $global:SQLFileWatcher Changed -SourceIdentifier SqlFileChanged -Action { #Only called when a new file is added to DB project Write

Function name is ambigious in SQL server

邮差的信 提交于 2019-12-11 08:45:50
问题 Based on this question, I've created a function and added it to my database. Now I want to use that function as a calculated column: -- Based on https://stackoverflow.com/a/1012802/10406502 (work by Even Mien) CREATE FUNCTION [dbo].[StripCharacters] ( @String NVARCHAR(MAX), @MatchExpression VARCHAR(255) ) RETURNS NVARCHAR(MAX) AS BEGIN SET @MatchExpression = '%['+@MatchExpression+']%' WHILE PatIndex(@MatchExpression, @String) > 0 SET @String = Stuff(@String, PatIndex(@MatchExpression, @String

TeamCity build step — FAILED in MSBuild

怎甘沉沦 提交于 2019-12-10 23:59:02
问题 The solution builds successfully on my machine but not on the build server. There are the project's solution Projects within solution This is the MSBuild output [13:42:17][Step 2/5] MSBuild output [13:42:17][MSBuild output] Focal.Business.Library -> D:\BuildAgent\work\9d2a77191c8abcc1\Focal.Business.Library\bin\Release\Focal.Business.Library.exe [13:42:17][MSBuild output] Copying file from "obj\Release\Focal.Business.Library.pdb" to "bin\Release\Focal.Business.Library.pdb". [13:42:17][MSBuild