Reputation: 9554
I have a development MySQL db which i am cleaning up. I am deleting some test views.
How can I check if a view is referenced by other views?
Upvotes: 3
Views: 1618
Reputation: 1741
There is an information schema table which stores view definitions. You could use something like:
SELECT * FROM information_schema.VIEWS
WHERE table_schema = 'your schema'
AND view_definition LIKE '%referenced_view%';
Which will give you back all views that reference 'referened_view' in their definition
Upvotes: 3