我正在 Windows 2012 R2 上使用 Visual Studio 2013 处理 SQL Server 数据库项目。下面是我的代码,您可以从我的共享保管箱链接 https://www.dropbox.com/s/aalnlwvxutr4g0f/UDF.zip?dl=1 下载整个项目源代码
using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
public partial class UserDefinedFunctions
{
[Microsoft.SqlServer.Server.SqlFunction]
public static SqlString Greetings(SqlString name)
{
// Put your code here
return new SqlString("Hello " + (string)name);
}
}
当我尝试构建解决方案时,我收到以下消息。
------ Build started: Project: UDF, Configuration: Debug Any CPU ------ Creating a model to represent the project... Done building project "UDF.sqlproj" -- FAILED.
Build FAILED. ========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========
本质上它告诉我构建失败,但我找不到任何具体错误。此外,“错误列表” Pane 下没有列出任何内容。请给我指出正确的方向吗?
最佳答案
您需要安装最新版本的 SQL Server Data Tools 这是链接
http://msdn.microsoft.com/en-US/data/hh297027
http://go.microsoft.com/fwlink/?linkid=393521&clcid=0x409
安装后重新启动计算机并尝试再次构建。
关于sql - Visual Studio 2013 SQL Server 数据库项目构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29093735/