SSMS在更新后停止加载我的存储过程

时间:2021-06-04 02:02:39

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:

今天我安装了Microsoft SQL Server Management Studio(SSMS)版本13.0.15800.18 [2016-09-20,16.4],现在它拒绝编辑我的存储过程。我甚至在我的另一台电脑上尝试了一个稍微旧的版本以确保它们在那里打开就好了。我收到错误:

SSMS在更新后停止加载我的存储过程

Script failed for StoredProcedure 'xyz'. (Microsoft.SqlServer.Smo)

StoredProcedure'xyz'的脚本失败。 (Microsoft.SqlServer.Smo)

Additional information:

Syntax error in TextHeader of StoredProcedure 'xyz'. (Microsoft.SqlServer.Smo)

StoredProcedure'xyz'的TextHeader中的语法错误。 (Microsoft.SqlServer.Smo)

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:

一些旧帖子(1,2,3)在线谈论这是由于在“ALTER PROCEDURE”之前嵌套注释(或者通常只是在某个程序中)。就我而言,在最近的SSMS更新之后,我的脚本都没有打开。我在另一台带有较旧版本SSMS的计算机上查看了一个较简单的脚本,整个过程中唯一的注释是一个简单的自动生成的注释,内容如下:

/****** Object: StoredProcedure [dbo].[xyz] Script Date: 9/21/2016 12:55:48 PM ******/

/ ******对象:StoredProcedure [dbo]。[xyz]脚本日期:9/21/2016 12:55:48 PM ****** /

Has anyone else run into this problem after the 2016-09-20 update of SSMS, and has anyone got a solution?

有没有其他人在2016-09-20更新SSMS后遇到这个问题,有没有人有解决方案?

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.

更新1:lhsoftware的提示(下面)使用Create To工作来打开程序。我尝试修改其中一个简单的程序,完全没有任何注释,并且在尝试修改它时仍然会出现“脚本失败”错误!我甚至后来用sp_helptext检查了这个过程,实际上它不包含任何斜杠(/)或星号(*)。

Update 2: Microsoft has officially rescinded the update, with the following message (found here):

更新2:Microsoft已正式撤销更新,并显示以下消息(在此处找到):

There is a known issue with the SSMS 16.4 release and we have rolled back the download to SSMS 16.3. We will update the download link when the issue has been resolved.

SSMS 16.4版本存在已知问题,我们已将下载回滚到SSMS 16.3。我们将在问题解决后更新下载链接。

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.

如果您已安装SSMS 16.4并希望恢复为SSMS 16.3,则必须在安装SSMS 16.3之前卸载SSMS 16.4。

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.

更新3:该错误已在版本16.4.1(13.0.15900.1)中得到解决。对我来说,自安装16.4.1以来,修改和更改都会再次工作。

6 个解决方案

#1


1  

"Script Stored Procedure As > Create To" will work. And you can manually change it to Alter. jhipp's suggestion works as well.

“脚本存储过程为>创建到”将起作用。您可以手动将其更改为Alter。 jhipp的建议也有效。

Note:

"Script Stored Procedure As > Alter To" will return the same error as "Modify"

“脚本存储过程为>更改为”将返回与“修改”相同的错误

#2


3  

Microsoft SQL team released an update (version 13.0.15900.1) that resolves this issue: (Download SQL Server Management Studio (16.4.1))

Microsoft SQL团队发布了一个解决此问题的更新(版本13.0.15900.1):(下载SQL Server Management Studio(16.4.1))

Note that the workaround for version 13.0.15800.18: Tools -> Options -> SQL Server Object Explorer -> Scripting -> Convert user-defined data types to base types = True

请注意版本13.0.15800.18的变通方法:工具 - >选项 - > SQL Server对象资源管理器 - >脚本 - >将用户定义的数据类型转换为基本类型= True

Is adding "EXECUTE AS CALLER" to stored procedures and scalar functions

将“EXECUTE AS CALLER”添加到存储过程和标量函数中

Once you install version: 13.0.15800.18 even if you uninstall and install an older version (Previous SQL Server Management Studio Releases) the problem continues

安装版本:13.0.15800.18即使卸载并安装旧版本(以前的SQL Server Management Studio版本),问题仍然存在

#3


1  

It's happening to me as well -- it looks to be a common issue with the latest update.

它也发生在我身上 - 它似乎是最新更新的常见问题。

Somebody logged a bug for MS which has had some activity that you can follow here: https://connect.microsoft.com/SQLServer/Feedback/Details/3103831

有人记录了一个MS的错误,它有一些你可以遵循的活动:https://connect.microsoft.com/SQLServer/Feedback/Details/3103831

A current workaround is to update Tools -> Options -> SQL Server Object Explorer -> Scripting -> Convert user-defined data types to base types = True, however this might have some unintended consequences.

当前的解决方法是更新工具 - >选项 - > SQL Server对象资源管理器 - >脚本 - >将用户定义的数据类型转换为基本类型= True,但这可能会产生一些意想不到的后果。

I'm currently using SSMS 2014 in the meantime. Hopefully they get a fix out quickly (though I'm not crossing my fingers).

我目前正在使用SSMS 2014。希望他们能很快得到解决方案(虽然我没有交叉)。

#4


1  

Microsoft is aware of the issue and released a quality version public release includes the fix

微软知道这个问题并发布了一个高质量的版本公开发布包括修复

https://connect.microsoft.com/SQLServer/feedback/details/3103831

#5


0  

Also, instead of Modifying the SP from SSMS, try scripting it as Alter To New Query Window.

此外,不是从SSMS修改SP,而是尝试将其编写为“更改为新查询窗口”。

#6


0  

It's a bug and I hope there will be a fix soon. The workaround I use is: Use the CREATE script option and change the CREATE to ALTER by yourself. Which is suggested here: https://connect.microsoft.com/SQLServer/Feedback/Details/3103831.

这是一个错误,我希望很快就能解决。我使用的解决方法是:使用CREATE脚本选项并自行将CREATE更改为ALTER。这里建议:https://connect.microsoft.com/SQLServer/Feedback/Details/3103831。

#1


1  

"Script Stored Procedure As > Create To" will work. And you can manually change it to Alter. jhipp's suggestion works as well.

“脚本存储过程为>创建到”将起作用。您可以手动将其更改为Alter。 jhipp的建议也有效。

Note:

"Script Stored Procedure As > Alter To" will return the same error as "Modify"

“脚本存储过程为>更改为”将返回与“修改”相同的错误

#2


3  

Microsoft SQL team released an update (version 13.0.15900.1) that resolves this issue: (Download SQL Server Management Studio (16.4.1))

Microsoft SQL团队发布了一个解决此问题的更新(版本13.0.15900.1):(下载SQL Server Management Studio(16.4.1))

Note that the workaround for version 13.0.15800.18: Tools -> Options -> SQL Server Object Explorer -> Scripting -> Convert user-defined data types to base types = True

请注意版本13.0.15800.18的变通方法:工具 - >选项 - > SQL Server对象资源管理器 - >脚本 - >将用户定义的数据类型转换为基本类型= True

Is adding "EXECUTE AS CALLER" to stored procedures and scalar functions

将“EXECUTE AS CALLER”添加到存储过程和标量函数中

Once you install version: 13.0.15800.18 even if you uninstall and install an older version (Previous SQL Server Management Studio Releases) the problem continues

安装版本:13.0.15800.18即使卸载并安装旧版本(以前的SQL Server Management Studio版本),问题仍然存在

#3


1  

It's happening to me as well -- it looks to be a common issue with the latest update.

它也发生在我身上 - 它似乎是最新更新的常见问题。

Somebody logged a bug for MS which has had some activity that you can follow here: https://connect.microsoft.com/SQLServer/Feedback/Details/3103831

有人记录了一个MS的错误,它有一些你可以遵循的活动:https://connect.microsoft.com/SQLServer/Feedback/Details/3103831

A current workaround is to update Tools -> Options -> SQL Server Object Explorer -> Scripting -> Convert user-defined data types to base types = True, however this might have some unintended consequences.

当前的解决方法是更新工具 - >选项 - > SQL Server对象资源管理器 - >脚本 - >将用户定义的数据类型转换为基本类型= True,但这可能会产生一些意想不到的后果。

I'm currently using SSMS 2014 in the meantime. Hopefully they get a fix out quickly (though I'm not crossing my fingers).

我目前正在使用SSMS 2014。希望他们能很快得到解决方案(虽然我没有交叉)。

#4


1  

Microsoft is aware of the issue and released a quality version public release includes the fix

微软知道这个问题并发布了一个高质量的版本公开发布包括修复

https://connect.microsoft.com/SQLServer/feedback/details/3103831

#5


0  

Also, instead of Modifying the SP from SSMS, try scripting it as Alter To New Query Window.

此外,不是从SSMS修改SP,而是尝试将其编写为“更改为新查询窗口”。

#6


0  

It's a bug and I hope there will be a fix soon. The workaround I use is: Use the CREATE script option and change the CREATE to ALTER by yourself. Which is suggested here: https://connect.microsoft.com/SQLServer/Feedback/Details/3103831.

这是一个错误,我希望很快就能解决。我使用的解决方法是:使用CREATE脚本选项并自行将CREATE更改为ALTER。这里建议:https://connect.microsoft.com/SQLServer/Feedback/Details/3103831。