简体   繁体   中英

Find a word in stored views of MySQL

I have over a hundred Views and over a hundred Entity's in my MySQL database. I need to remove one attribute from one Entity(table). After which i will have to look for where in all the views that attribute was used so that i could modify the view.

Is there any other way than opening up each view and looking for the Attribute of the Entity.

I do have EDMX & Designer files for Entities & Views and in my Project

You can utilize information schema for this. Try something like this:

SELECT TABLE_NAME FROM information_schema.views WHERE VIEW_DEFINITION LIKE '%your_word%';

Above query is not tested, but it will give you the name of the view which contains the word you are searching for. You can also refer to the docs on information_schema.views and craft a query which is more suitable for your needs: The INFORMATION_SCHEMA VIEWS Table

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM