Find objects in mysql

Asked

Viewed 444 times

3

Good afternoon, I am using Workbeanch 6.3 and I need to search in the Mysql database if a particular Column exists and what its Table, I also need to know if a particular Column is used in a Procedure or View, for example in Sql Server I do so;

      SELECT O.name as Tabelas 
        FROM syscolumns C 
  INNER JOIN sysobjects O ON C.id = O.id 
       WHERE c.name like '%idConta%'

1 answer

1


You could try so, where no like passes the idConta

SELECT SPECIFIC_NAME FROM information_schema.routines WHERE ROUTINE_DEFINITION like '%idConta%'

To discover object definers, work in the 'information_schema' table, where you get the information of objects, you will get a lot of things in it. Below are examples of select to discover the definers.

SELECT specific_name, routine_schema, routine_name, routine_type, definer FROM information_schema.routines WHERE definer = 'seu_user'; 

SELECT trigger_catalog, trigger_schema, trigger_name, definer FROM information_schema.triggers WHERE definer = 'seu_user';

SELECT table_catalog, table_schema, table_name, definer FROM information_schema.views WHERE definer = 'seu_user';

Browser other questions tagged

You are not signed in. Login or sign up in order to post.