1. 程式人生 > >獲取資料庫中包含某個關鍵詞的所有表名(Sqlserver、MySQL、Oracle)

獲取資料庫中包含某個關鍵詞的所有表名(Sqlserver、MySQL、Oracle)

1.sqlserver
select name as table_name from sys.objects where type='U' and name like '%關鍵詞%'

2.mysql
SELECT distinct TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME LIKE '%關鍵詞%'

3.oracle
select table_name from user_tables where table_name like '%關鍵詞%'