Reputation: 49
How to get the total count of stored procedures in a MySQL database? Do I look in the information schema?
Upvotes: 3
Views: 11092
Reputation: 1072
This worked for me
SELECT
COUNT(*) as 'Stored Procedures'
FROM SYS.OBJECTS
WHERE TYPE ='P'
GROUP BY TYPE
Upvotes: 0
Reputation: 1290
Try this solution, just replace your database name in the last line.
SELECT count(ROUTINE_NAME)procedure_count
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_TYPE="PROCEDURE"
AND ROUTINE_SCHEMA="your database name";
Upvotes: 3
Reputation: 158
You can use this to see the list of Procedures
SELECT ROUTINE_NAME
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_TYPE="PROCEDURE"
AND ROUTINE_SCHEMA="dbname";
You can find out more here
Upvotes: 10