Home > Database > Mysql Tutorial > body text

删除所有存储过程

WBOY
Release: 2016-06-07 14:56:34
Original
1381 people have browsed it

删除所有存储过程的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  
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template