SQL Management Studio Express 在记事本中打开 SQL 脚本
当我转到“文件”>“ 打开> 文件并选择一个 .sql 脚本,或者甚至当我将 .sql 文件拖到 SQL Management Studio Express 窗口中时,它会在记事本中打开该脚本,当我想运行该脚本时,这是完全无用的。
由于这是在外部服务器(Windows 2003 Server)上,因此我最终必须断开与 RDP 的连接,禁用本地剪贴板,重新连接,然后从 Textpad 复制粘贴脚本内容才能运行它。
我已经检查了选项菜单,但看不到任何与记事本相关的内容,甚至在“外部工具”部分也看不到。 有什么想法为什么要这样做吗?
请注意:我已检查 SQL 脚本的文件关联,并将其设置为 SQL Management Studio Express。
When I go to File > Open > File and select a .sql script, or even when I drag a .sql file into the SQL Management Studio Express window, it opens the script in Notepad which is totally useless when I want to run the script.
Since this is on an external server (Windows 2003 Server), I end up having to disconnect from RDP, disable the local clipboard, re-connect and then copy-paste the script's contents from Textpad in order to run it.
I've checked the options menus but can't see anything relating to Notepad, not even in the "external tools" section. Any ideas why it would be doing this?
Please note: I have checked the file association for SQL scripts and it is set to SQL Management Studio Express.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
今天早上遇到这个。 结果对我来说是一个编码问题。 我在 UltraEdit 中打开脚本,我注意到它显示的编码是 U-DOS 而不是 DOS。 我运行了 Unicode 到 ASCII 的转换(也在 UltraEdit 中),保存了文件,现在 Management Studio 可以正确打开文件。
Ran into this this morning. Turned out to be an encoding issue for me. I opened the script up in UltraEdit and I noticed that it was showing the encoding to be U-DOS instead of DOS. I ran the Unicode to ASCII conversion (also in UltraEdit), saved the file, and now Management Studio is opening up the files correctly.
我也遇到了这个问题 - 感谢 NFrank 发现了这个问题:
这是由于在 TextPad 中打开脚本并意外保存为 Unicode 造成的。 该问题与文件关联无关。
解决方案:在记事本(或文本板)中打开 - 另存为...并选择编码:ANSI
I encountered this too - thanks NFrank for spotting the issue:
This was caused by opening the script in TextPad and accidentally saving as Unicode. The issue is not related to file associations.
The solution: Open in Notepad (or TextPad) - Save As... and select Encoding: ANSI
更新:
在 SQL Management Studio 中,
Matt
UPDATE:
In SQL Management Studio,
Matt
我要检查的第一件事是查看与该框中的 SQL 文件关联的应用程序是否是记事本。
The first thing I'd check is to see if the application associated with SQL files on that box is Notepad.