SQL Server Management Studio中'go'附近的语法不正确 [英] Incorrect syntax near 'go' in SQL Server Management Studio

查看:130
本文介绍了SQL Server Management Studio中'go'附近的语法不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

执行以下SQL:

drop function f
go

在MS Sql Server Management Studio中给我这个解析错误:

in MS Sql Server Management Studio give me this parse error:

第15级,州1,第1行的消息102 'go'附近的语法不正确.

Msg 102, Level 15, State 1, Line 1 Incorrect syntax near 'go'.

为什么?

如果我打开一个新选项卡并将SQL复制/粘贴到它中,它也会失败. 但是,如果我打开一个新选项卡并完全重新输入SQL,它就可以正常工作.

If I open a new tab and copy/paste the SQL into it, it also fails. But If I open a new tab and retype the SQL entirely, it works fine.

推荐答案

SQL Server Management Studio无法处理某些不可打印的字符.

SQL Server Management Studio can't handle some non printable characters.

检查换行符,可能您使用的是Linux(LF)或Mac样式(CR),而不是Windows样式(CR和LF).您可以使用任何高级文本编辑器进行检查,例如 Notepad ++ ·

Check the newline characters, probably you have Linux (LF) or Mac style (CR) instead of Windows style (CR and LF). You can check with any advanced text editor, for example Notepad++·

这篇关于SQL Server Management Studio中'go'附近的语法不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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