我将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命令中,但也不起作用。
我确认我的sqlproj中有行<ValidateCasingOnIdentifiers>False</ValidateCasingOnIdentifiers>,当我在visual studio中的项目属性图形用户界面中单击项目设置中的复选框时,该行被放在那里。
发布于 2019-02-18 01:26:00
我在我的sqlproj文件中添加了一行代码,直接放在<ValidateCasingOnIdentifiers>False</ValidateCasingOnIdentifiers>的位置下,这样它就可以工作了
<SuppressTSqlWarnings>71558</SuppressTSqlWarnings>
https://stackoverflow.com/questions/54735382
复制相似问题