msql 清库

 

SELECT concat('DROP TABLE IF EXISTS ', table_name, ';')
FROM information_schema.tables
WHERE table_schema = 'dr_staging3_plyck';




select concat('DROP PROCEDURE IF EXISTS ', name, ';') 
from mysql.proc where db = 'dr_staging3_plyck' and `type` = 'PROCEDURE' ;

select concat('DROP FUNCTION IF EXISTS ', name, ';') 
from mysql.proc where db = 'dr_staging3_plyck' and `type` = 'FUNCTION' ;

 

SELECT concat('DROP TABLE IF EXISTS ', table_name, ';')
FROM information_schema.tables
WHERE table_schema = 'mydb';

select `name` from mysql.proc where db = 'your_db_name' and `type` = 'PROCEDURE' ;
select `name` from mysql.proc where db = 'your_db_name' and `type` = 'FUNCTION' ;
select concat('DROP PROCEDURE IF EXISTS ', name, ';') 
from mysql.proc where db = 'dr_staging1_shia' and `type` = 'PROCEDURE' ; select concat('DROP FUNCTION IF EXISTS ', name, ';')
from mysql.proc where db = 'dr_staging1_shia' and `type` = 'FUNCTION' ;
DROP PROCEDURE IF EXISTS PROC_UPR_DZ; DROP FUNCTION IF EXISTS Code_To_Cnm;

 

posted @ 2021-11-21 17:01  xiluhua  阅读(73)  评论(0编辑  收藏  举报