Find all MySQL Stored Procedure calls?

后端 未结 3 767
灰色年华
灰色年华 2021-02-07 14:16

For a given MySQL DB that I use and modify occasionally I had to recently make some changes to some tables and stored procedures. There are places in this DB where procedures m

相关标签:
3条回答
  • 2021-02-07 14:43

    Wow this is awesome! I'm using this to search for text in my MySQL database:

    SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_DEFINITION LIKE "%search_string%";
    
    0 讨论(0)
  • 2021-02-07 14:49

    Well, I finally stumbled upon the following solution:

    The INFORMATION_SCHEMA.ROUTINES table has information that can be very useful when trying to track down CALLs from one SP to another. I used the following:

    SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_DEFINITION LIKE "%SomeProc%";
    

    And this retrieved all the store procedures that contained SomeProc.

    0 讨论(0)
  • 2021-02-07 14:56

    I found this to be a more succinct list. I post-fix all my stored procs with '_sp' which helps when searching for them:

    SELECT ROUTINE_NAME FROM information_schema.ROUTINES WHERE ROUTINE_NAME LIKE "%_sp";
    
    0 讨论(0)
提交回复
热议问题