sqlmysqldatabasestored-proceduresstored-functions

Show procedure definition in MySQL


What is the MySQL command to show the definition of a procedure, similar to sp_helptext in Microsoft SQL Server?

I know that SHOW PROCEDURE STATUS will display the list of the procedures available. I need to see a single procedure's definition.


Solution

  • SHOW CREATE PROCEDURE <name>
    

    Returns the text of a previously defined stored procedure that was created using the CREATE PROCEDURE statement. Swap PROCEDURE for FUNCTION for a stored function.