Drop all stored procedures in MySQL or using temporary stored procedures

后端 未结 7 2059
逝去的感伤
逝去的感伤 2020-12-13 20:39

Is there a statement that can drop all stored procedures in MySQL? Alternatively (if the first one is not possible), is there such thing as temporary stored procedures in My

7条回答
  •  鱼传尺愫
    2020-12-13 20:58

    I use select statement to display all Drop Procedure statements of a specific database in one cell. Then copy it to query window.

    SET group_concat_max_len = 4096;
    
    SELECT GROUP_CONCAT(Procedures SEPARATOR '; ') From (SELECT CONCAT(
    "DROP PROCEDURE IF EXISTS `",SPECIFIC_NAME, '`') AS Procedures 
    FROM information_schema.ROUTINES R WHERE R.ROUTINE_TYPE = "PROCEDURE" 
    AND R.ROUTINE_SCHEMA = 'my_database_name') As CopyThis; 
    

提交回复
热议问题