如何解决[[语法错误:'创建过程'必须是批处理中唯一的语句]]< == MSSQL 2008中的此错误 [英] How To solve [[Incorrect Syntax: 'Create procedure' must be the only statement in the batch ]] <== This Error In MSSQL 2008

查看:108
本文介绍了如何解决[[语法错误:'创建过程'必须是批处理中唯一的语句]]< == MSSQL 2008中的此错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CREATE PROCEDURE HELLO @REMARKS VARCHAR (20) -- <-This Line Shows Error
AS Begin

End

推荐答案

您可能在Management Studio中有更多语句,并且您可以同时运行它们。创建过程应该是批处理中唯一的语句。



例如以下内容会导致问题

You probably have more statements than this in the Management Studio and you run them all at the same time. Procedure creation should be the only statement in a batch.

For example the following would cause a problem
select getdate()

CREATE PROCEDURE HELLO @REMARKS VARCHAR (20) -- <-This Line Shows Error
AS Begin
  print 'Hi';
End



解决此问题的最简单方法是使用鼠标选择创建程序部分然后运行它。这样只执行选择


Perhaps the easiest way to tackle this is using mouse to select the create procedurio portion and then run it. This way only the selection is executed


这篇关于如何解决[[语法错误:'创建过程'必须是批处理中唯一的语句]]&lt; == MSSQL 2008中的此错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆