Visual studio 中编译错误SQL71006: Only one statement is allowed per batch. A batch separator, such as 'GO', might be required between statements.

把写好的sql脚本,并在mssqlmanager里面编译成功的存储过程脚本复制到vs项目下,出现错误信息如下:SQL71006: Only one statement is allowed per batch. A batch separator, such as ‘GO‘, might be required between statements.加上GO,出现

Error 5 SQL70001: This statement is not recognized in this context.

大意是不允许多条语句在一个脚本里面。

 

解决方案:VS错认为你的文件是DDL文件,所以它试图编译,解决方案是,右键文件---属性-----Build Action---None

Visual studio 中编译错误SQL71006: Only one statement is allowed per batch. A batch separator, such as 'GO', might be required between statements.,古老的榕树,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。