database-project

Visual Studio Database project: checking if SQL server login exists before creating it

断了今生、忘了曾经 提交于 2019-11-30 14:44:44
问题 When I create a Visual Studio database project for SQL 2012 and synchronise it with an existing database (using Compare Schema), I also synchronise a SQL server login. Visual Studio generates the following script for the login: CREATE LOGIN [my_user] WITH PASSWORD = 'somesecurepass' When I try to publish the generated SQL on a server where this login exists, sqlcmd shows me an error: The server principal my_user already exists. When I look at the sql script generated by Visual Studio, I see

Build error in tfsbuild with database project

无人久伴 提交于 2019-11-30 08:21:34
I have setup my .NET project in TFS Build. It builds fine locally, but I am getting this build error on the server: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. I have no idea what it is, even googling didn't help much. My solution has some database projects. What is the issue here and how I can fix it? Preet Sangha You need to install the SQL Server Data Tools on all build agents . When installing

Is it possible to make SQLCMD Mode 'Sticky' in Database Projects

こ雲淡風輕ζ 提交于 2019-11-30 08:04:09
I have a database project in Visual Studio 2013, with a post deployment script that uses SQLCMD mode. The problem I am having is that the project defaults to non-SQLCMD mode every time the project is opened. This means that every time the project is opened, the Error List will be flooded with errors like "Incorrect syntax near ':'." until the developer opens the deployment script and clicks the SQLCMD Mode button. Is there a way to default to keeping SQLCMD Mode on so developers don't have to do this each time they open the project? Had to dig a little for this one: Go to the Tools|Options

Is it possible to create an asymmetric key for a .NET framework assembly in SQL Server 2014?

不打扰是莪最后的温柔 提交于 2019-11-30 03:11:10
问题 I am developping an SQL Server Database Project in Visual Studio which is in fact a User Defined Function. In this project, I included Json.NET as a reference (using NuGet). I managed to publish (and make work) my assembly and the UDF to my SQL Server instance by first turning the database TRUSTWORTHY ON (since my project is UNSAFE) and then running this: CREATE ASSEMBLY [System.Runtime.Serialization] FROM 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Runtime.Serialization.dll' WITH

Build error in tfsbuild with database project

北城余情 提交于 2019-11-29 11:07:21
问题 I have setup my .NET project in TFS Build. It builds fine locally, but I am getting this build error on the server: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. I have no idea what it is, even googling didn't help much. My solution has some database projects. What is the issue here and how I can

Is it possible to make SQLCMD Mode 'Sticky' in Database Projects

余生颓废 提交于 2019-11-29 11:00:39
问题 I have a database project in Visual Studio 2013, with a post deployment script that uses SQLCMD mode. The problem I am having is that the project defaults to non-SQLCMD mode every time the project is opened. This means that every time the project is opened, the Error List will be flooded with errors like "Incorrect syntax near ':'." until the developer opens the deployment script and clicks the SQLCMD Mode button. Is there a way to default to keeping SQLCMD Mode on so developers don't have to

Visual Studio 2010 Database Project - Unresolved Reference to a Synonym

隐身守侯 提交于 2019-11-28 21:27:43
We have a couple of synonyms that are being used to reference tables in a separate database (that's on the same server). The actual synonyms are fine, but the stored procs/user defined functions that reference said synonyms show the following error: Error 13 SQL03006: Column: [dbo].[GetCocosIndexSearched].[User ID] contains an unresolved reference to an object. Either the object does not exist or the reference is ambiguous because it could refer to any of the following objects: [dbo].[AuditType].[e]::[LOGIN_ID], [dbo].[EMPLOYEES].[e]::[LOGIN_ID], [dbo].[EMPLOYEES].[LOGIN_ID] or [dbo].

Visual Studio 2013: Database Project MSBuild error

倖福魔咒の 提交于 2019-11-28 19:03:22
I've got a database project as part of my solution in Visual Studio 2013. Been working perfectly for the last 3 weeks and now suddenly today it won't build and so I cannot publish any changes. I'm getting an MSBuild error: "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(513,5): Error: MSB4018: The "SqlBuildTask" task failed unexpectedly. System.MethodAccessException: Attempt by method 'Microsoft.Data.Tools.Schema.Sql.Build.SqlTaskHost.OnCreateCustomSchemaData(System.String, System.Collections.Generic.Dictionary`2)' to access method

VS2013 Database Project fails to build

我只是一个虾纸丫 提交于 2019-11-28 18:31:48
I created a new SQL Server Database Project in VS2013 (Update 3) and attempted to build but it fails. The only build output I receive follows: ------ Build started: Project: Database1, Configuration: Debug Any CPU ------ Creating a model to represent the project... Done building project "Database1.sqlproj" -- FAILED. Build FAILED. ========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ========== If I build the project via MSBuild.exe with detail verbosity I see the following inner failure: Task "SqlBuildTask" Creating a model to represent the project... Done executing task

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

怎甘沉沦 提交于 2019-11-28 18:30:06
What is the function of the DBMDL file in a visual studio database project? 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