为什么我不能使用sql server 2005中的drop procedure语句从不同的模式中删除过程

时间:2022-02-19 12:43:51

As simple as it is :

尽可能简单:

 drop procedure schemaName.procName

Gets the following error msg:

获取以下错误消息:

Msg 3701, Level 11, State 5, Line 2 Cannot drop the procedure 'procName', because it does not exist or you do not have permission. Edit: I tried also using Sql based authentication - still does not work

消息3701,级别11,状态5,行2不能删除过程'procName',因为它不存在或您没有权限。编辑:我也尝试使用基于Sql的身份验证 - 仍然无法正常工作

Strange that I am able to drop the procedure via the GUI.

奇怪的是我能够通过GUI删除程序。

I do have permissions - I am running with Windows authentication as sysadmin

我有权限 - 我使用Windows身份验证作为sysadmin运行

1 个解决方案

#1


It is really hard to offer ideas to you about why this would be acting like this. What you can do is open SQL Profiler, and create a Trace on the SQL:StmtStarting/BatchStarting, RPC:Starting, and SP:Starting,StmtStarting events and actually capture the drop being issued by SQL Server Management studio through the UI and then compare that to the DDL that you are trying to manually write. At least then you will know exactly how SSMS is doing the drop.

很难向你提供关于为什么会这样做的想法。您可以做的是打开SQL事件探查器,并在SQL上创建一个跟踪:StmtStarting / BatchStarting,RPC:Starting和SP:Starting,StmtStarting事件,并实际捕获SQL Server Management Studio通过UI发出的丢弃然后进行比较对于您尝试手动编写的DDL。至少那时你就会知道SSMS究竟是如何进行丢弃的。

#1


It is really hard to offer ideas to you about why this would be acting like this. What you can do is open SQL Profiler, and create a Trace on the SQL:StmtStarting/BatchStarting, RPC:Starting, and SP:Starting,StmtStarting events and actually capture the drop being issued by SQL Server Management studio through the UI and then compare that to the DDL that you are trying to manually write. At least then you will know exactly how SSMS is doing the drop.

很难向你提供关于为什么会这样做的想法。您可以做的是打开SQL事件探查器,并在SQL上创建一个跟踪:StmtStarting / BatchStarting,RPC:Starting和SP:Starting,StmtStarting事件,并实际捕获SQL Server Management Studio通过UI发出的丢弃然后进行比较对于您尝试手动编写的DDL。至少那时你就会知道SSMS究竟是如何进行丢弃的。