当前位置:Gxlcms > mysql > 删除所有存储过程

删除所有存储过程

时间:2021-07-01 10:21:17 帮助过:10人阅读

删除所有存储过程的sql语句 无 DECLARE @procName VARCHAR(500)DECLARE cur CURSOR FOR SELECT [name] FROM sys.objects WHERE type = 'p'OPEN curFETCH next FROM cur INTO @procNameWHILE @@fetch_status = 0 BEGIN EXEC('drop procedure ' + @procName) FE

删除所有存储过程的sql语句
<无>
 DECLARE @procName VARCHAR(500)
DECLARE cur CURSOR FOR
  SELECT [name]
  FROM   sys.objects
  WHERE  type = 'p'

OPEN cur

FETCH next FROM cur INTO @procName

WHILE @@fetch_status = 0
  BEGIN
      EXEC('drop procedure ' + @procName)

      FETCH next FROM cur INTO @procName
  END

CLOSE cur

DEALLOCATE cur  

人气教程排行