0

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

请注意,从 Visual Studio 中构建时,未按预期显示警告。

这是我在 cmdline 上运行的内容:

"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 命令,但这也不起作用。

<ValidateCasingOnIdentifiers>False</ValidateCasingOnIdentifiers>当我在 Visual Studio 的项目属性 GUI 中单击项目设置中的复选框时,我确认我的 sqlproj 具有放置在那里的行。

4

1 回答 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

于 2019-02-17T17:25:59.880 回答