Danish Kp
Danish Kp

Reputation: 49

Total count of stored procedures in Mysql database

How to get the total count of stored procedures in a MySQL database? Do I look in the information schema?

Upvotes: 3

Views: 11092

Answers (3)

pradeepradyumna
pradeepradyumna

Reputation: 1072

This worked for me

SELECT     
    COUNT(*) as 'Stored Procedures'     
FROM SYS.OBJECTS
WHERE TYPE ='P'
GROUP BY TYPE

Upvotes: 0

Vishal
Vishal

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

Sharvil Popli
Sharvil Popli

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

Related Questions