10

我得到错误

以下 SqlCmd 变量缺少值:Path1 Path2。

在 Visual Studio 的几个 Sql 项目中。

我试着用谷歌搜索它,但什么也没找到。

4

4 回答 4

10

选择 SQL 项目。转到项目的属性(ALT + Enter)。导航到 SQLCMD 变量并采取相应措施(删除变量或填写默认值)。

于 2013-01-12T19:53:42.357 回答
2

I ran in to this yesterday after tinkering with the project settings for my database project (right-click the database project, click properties, then click the Project Settings).

I had checked the Create script (.sql file) option and things continued to work as normal for me. But when another team member checked out the the latest update, they could not build and got the error about missing values for SqlCmd variables. Things still worked for me though until I checked out a fresh version of the source and started getting the same error.

To fix, I simply unchecked the Create script (.sql file) setting and all was well again.

于 2013-05-02T06:55:07.690 回答
1

我遇到了这个问题。我添加了一些 SQLCMD 变量然后删除了它们。SQLCMD 变量不再存在于发布文件或 .sqlproj 文件中。我对项目中的所有文件进行了grep,并且变量在任何地方都不存在。我重新启动了 Visual Studio。但是,我仍然得到 以下 SqlCmd 变量的缺失值:错误。

我从项目目录中删除了 *.dbmdl 和 *.sqlproj.vspcc 文件。该项目随后成功发布。

于 2019-05-21T14:55:56.280 回答
0

这也发生在我身上,结果发现其他人已经在项目上设置了一些自动日志记录,该项目映射了 sqlcmd 变量中的路径变量。在他们签入 tfs 后,由于此错误,我无法再构建。让他们清除路径并更新项目或匹配您这边的变量值。

于 2012-07-19T22:22:04.747 回答