错误SQL72014:找不到变量DatabaseName - DacPac,SSDT,SqlPackage.exe

时间:2017-03-30 07:15:25

标签: sql-server-data-tools dacpac sqlpackage

我无法意识到我做错了什么并在互联网上找到了什么 有谁知道下一次部署塞子的原因是什么?

可能是DacPac的众多设置。

Error SQL72014: SQL Execution error: A fatal error occurred. The variable DatabaseName could not be found.
Error SQL72045: Script execution error.  The executed script:
USE [$(DatabaseName)];


Error SQL72014: SQL Execution error: A fatal error occurred. Incorrect syntax was encountered while USE [$(DatabaseName)]; was being parsed.
Error SQL72045: Script execution error.  The executed script:
USE [$(DatabaseName)];

1 个答案:

答案 0 :(得分:2)

设置" CommentOutSetVarDeclarations"为false或以XML格式删除它。

对于Visual Studio UI:
发布数据库(PopUp) - >高级...(按钮) - >一般(标签) - >
取消选中Comment out SetVar declarations

我偶然点击了它。

然而我找到了它:https://stackoverflow.com/a/15158985/390940))