本文介绍了单行 GO(Batch) 语句在 SQL Server 中出错?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
我有一个问题.我正在创建以下程序临时.
I have one question. I was creating below procedure temporary.
当我以下面的格式执行它时,它工作正常:
When I Execute it in below format it works fine:
但是当我以下面的格式执行相同的 SQL 时,它给出错误提示:'GO' 附近的语法不正确."
But when I execute same SQL in below format it giving error saying: "Incorrect syntax near 'GO'."
如何在单行中用 GO 语句编写相同的 SQL?是否可以?如果不是,那为什么?
How to write same SQL with GO statement in single line? Is it possible? If not then Why?
谢谢,维沙尔
推荐答案
来自 GO (Transact-SQL)
Transact-SQL 语句不能与 GO 命令占据同一行.但是,该行可以包含注释.
A Transact-SQL statement cannot occupy the same line as a GO command. However, the line can contain comments.
所以除了注释之外,Go 需要独占一行.
So Go needs to be on its own line, except for comments.
这篇关于单行 GO(Batch) 语句在 SQL Server 中出错?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!