Jack
Jack

Reputation: 321

How to find out which stored procedure is using a specific table?

I have 100 stored procedures and some of those are using table_123. So how to find all stored procedures that are using this table?

I tried SHOW PROCEDURE STATUS but it is not giving me the right info that I want.

Upvotes: 1

Views: 42

Answers (1)

Martin Smith
Martin Smith

Reputation: 453327

Untested by me but possibly

SELECT *
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '%table_123%'

At the risk of a few false positives.

Upvotes: 1

Related Questions