Search of table names

前端 未结 9 1242
傲寒
傲寒 2021-01-29 22:10

I use the following to search for strings in my stored procedures:

use DBname
SELECT Name
FROM sys.procedures
WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE \'%xxx%\'
<         


        
9条回答
  •  情话喂你
    2021-01-29 23:02

    I want to post a simple solution for every schema you've got. If you are using MySQL DB, you can simply get from your schema all the table's name and add the WHERE-LIKE condition on it. You also could do it with the usual command line as follows:

    SHOW TABLES WHERE tables_in_ LIKE '%%';
    

    where tables_in_ returns the column's name of SHOW TABLES command.

提交回复
热议问题