[英]“Object reference not set to an instance of an object” when publishing a sql project VS 2013
When I try to publish a SQL Project to a database (SQL server 2008 r2) from Visual Studio 2013, I get a dialog box saying 当我尝试从Visual Studio 2013将SQL Project发布到数据库(SQL Server 2008 r2)时,出现一个对话框
"Object reference not set to an instance of an object"
and then the publish never finishes (the progress icon keeps spinning). 然后发布永远不会完成(进度图标不断旋转)。
When I click in the "Output" tab, I don't see any errors there. 当我单击“输出”选项卡时,在此看不到任何错误。 It says: 它说:
========== Build: 4 succeeded or up-to-date, 0 failed, 0 skipped ==========.
When I do a "Schema Compare" from VS 2013 between my project and the production database, I get the same error. 当我在项目和生产数据库之间执行VS 2013中的“架构比较”时,出现相同的错误。
Is there any way to track down how and why VS2013's Data Tools Operations is producing that error? 有什么方法可以追踪VS2013的数据工具操作如何以及为什么产生该错误?
I ran into this problem again. 我又遇到了这个问题。 My problem was that the definition of one of my table-valued functions in the server (the target server of the publish) had a SQLCmd parameter commented out: 我的问题是服务器(发布的目标服务器)中的表值函数之一的定义注释了一个SQLCmd参数:
CREATE FUNCTION MyProblematicFunc
(
@beg_date date,
@end_date date
)
RETURNS TABLE
AS
RETURN
(
SELECT
Name,
Address,
--,cast([$(DBreferenceFromVS)].[dbo].[ConvertNumToDate](NumericDate) as DATE) [Create Date]
-- ^^^^ This comment above was causing the error on publish and on schema comparison. I had to remove it in the server
FROM RandomTable
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.