问题描述
今天我安装了 Microsoft SQL Server Management Studio (SSMS) [2016-09-20, 16.4] 的 13.0.15800.18 版,现在它拒绝编辑我的存储过程.我什至在我的另一台计算机上尝试了一个稍旧的版本以确保它们在那里打开得很好.我收到错误:
Today I installed version 13.0.15800.18 of Microsoft SQL Server Management Studio (SSMS) [2016-09-20, 16.4], and now it refuses to edit my stored procedures. I even tried a slightly older version on my other computer to make sure, and they open just fine there. I get the error:
StoredProcedure 'xyz' 的脚本失败.(Microsoft.SqlServer.Smo)
附加信息:
StoredProcedure 'xyz' 的 TextHeader 中的语法错误.(Microsoft.SqlServer.Smo)
Syntax error in TextHeader of StoredProcedure 'xyz'. (Microsoft.SqlServer.Smo)
一些旧帖子(1、2、3) 网上说这个是之前嵌套注释导致的更改程序"(或者只是一般在某个地方的程序中).就我而言,在最近的 SSMS 更新之后,我的脚本都没有打开.我在另一台使用旧版 SSMS 的计算机上查看了我的一个更简单的脚本,整个过程中唯一的注释是一个简单的自动生成的注释,内容如下:
Some old posts (1, 2, 3) Online talk about this being caused by having nested comments before "ALTER PROCEDURE" (or just generally in the procedure somewhere). In my case, none of my scripts open after this most recent SSMS update. I viewed one of my simpler scripts on another computer with an older version of SSMS, and the only comment in the whole thing is a simple auto-generated comment that reads:
/****** 对象:StoredProcedure [dbo].[xyz] 脚本日期:2016 年 9 月 21 日下午 12:55:48 ******/
在 2016-09-20 更新 SSMS 之后有没有其他人遇到过这个问题,有没有人有解决方案?
Has anyone else run into this problem after the 2016-09-20 update of SSMS, and has anyone got a solution?
更新 1: lhsoftware 使用 Create To 的提示(如下)可用于打开程序.我尝试修改其中一个简单的程序,使其完全没有任何注释,但我仍然收到脚本失败"的提示.尝试修改时出错!我什至后来用 sp_helptext
检查了这个程序,确实它不包含任何斜线 (/) 或星号 (*).
Update 1: lhsoftware's tip (below) of using Create To works for opening the procedures. I tried modifying one of the simple procedures to have absolutely no comments at all, and I still get the "script failed" error when trying to Modify it! I even checked this procedure afterward with sp_helptext
, and indeed it contains no slashes (/) or stars (*) whatsoever.
更新 2: Microsoft 已正式取消更新,并附上以下消息(找到 此处):
Update 2: Microsoft has officially rescinded the update, with the following message (found here):
SSMS 16.4 版本存在一个已知问题,我们已将下载回滚到 SSMS 16.3.问题解决后,我们将更新下载链接.
如果您已安装 SSMS 16.4 并希望恢复到 SSMS 16.3,则必须在安装 SSMS 16.3 之前卸载 SSMS 16.4.
If you have installed SSMS 16.4 and would like to revert to SSMS 16.3, you must uninstall SSMS 16.4 prior to installing SSMS 16.3.
更新 3: 该错误已在版本 16.4.1 (13.0.15900.1) 中得到解决.对我来说,Modify 和 Alter To 都可以在安装 16.4.1.
Update 3: The bug has been resolved in version 16.4.1 (13.0.15900.1). For me, both Modify and Alter To work again since installing 16.4.1.
推荐答案
Script Stored Procedure As > Create To"将起作用.您可以手动将其更改为 Alter.jhipp 的建议也有效.
"Script Stored Procedure As > Create To" will work. And you can manually change it to Alter. jhipp's suggestion works as well.
注意:
Script Stored Procedure As > Alter To"将返回与Modify"相同的错误
"Script Stored Procedure As > Alter To" will return the same error as "Modify"
这篇关于更新后 SSMS 停止加载我的存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!