msbuild忽略使用SSDT sqlproj生成sql的ValidateCasingOnIdentifiers

问题描述 投票:0回答:1

我设置我的sqlproj不验证标识符的大小写,但是当我用msbuild生成一个sql脚本时,它似乎忽略了它并显示像warning SQL71558: The object reference [dbo].[table].[deleted] differs only by case from the object definition [dbo].[table].[Deleted].这样的警告。

请注意,在visual studio中构建时,不会按预期显示警告。

这是我在命令行运行的内容:

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe" /p:Configuration=Release /p:Platform=AnyCpu /p:TargetDatabaseName=dbName /p:TargetConnectionString="Data Source=.\SQLExpress;Initial Catalog=dbName;Integrated Security=True" /p:DeployScriptFileName=publish.sql /p:UpdateDatabase=False /p:CommentOutSetVarDeclarations=True /t:Rebuild,Deploy "c:\dev\project\Sql.sqlproj"

我还尝试将/p:ValidateCasingOnIdentifiers=False添加到msbuild命令,但这也不起作用。

当我点击visual studio中项目属性GUI中的项目设置中的复选框时,我确认我的sqlproj有行<ValidateCasingOnIdentifiers>False</ValidateCasingOnIdentifiers>

msbuild sql-server-data-tools sqlproj
1个回答
1
投票

我通过在我的sqlproj文件中添加一行来直接在<ValidateCasingOnIdentifiers>False</ValidateCasingOnIdentifiers>所在的地方工作:

<SuppressTSqlWarnings>71558</SuppressTSqlWarnings>

本文引导我发现:https://developercommunity.visualstudio.com/content/problem/19394/unable-to-suppress-build-warnings-for-sql-db-proje.html

© www.soinside.com 2019 - 2024. All rights reserved.