Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Quickly find tables with keywords in myql sqlserver

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

All libraries of sql server:

Declare @ I int,@id int,@dbname varchar, @ sql varchar @ set @ I = 6 set @ id= (select count (*) from master..sysdatabases) drop table # tcreate table # t (dbname varchar, tablename varchar, columnname varchar) while (@ I < @ id) begin set @ I = @ I + 1 Set @ dbname = (select name from master..sysdatabases where dbid= @ I) set @ sql = 'use' + @ dbname+';insert [# t] select table_catalog,table_name,column_name from information_schema.columns where column_name like''% pass%'' or column_name like''% pwd%'' or column_name like''% mail%''' exec (@ sql)-- print @ sql endselect * from # tdrop table # tgo

Sql server single library:

SELECT sysobjects.name as tablename, syscolumns.name as columnname FROM sysobjects JOIN syscolumns ON sysobjects.id = syscolumns.id WHERE sysobjects.xtype ='U' AND (syscolumns.name LIKE'% pass%' or syscolumns.name LIKE'% pwd%' or syscolumns.name LIKE'% first%')

Mysql:

Select table_schema,table_name,column_name from information_schema.columns where table_schema! = 0x696E666F726D6174696F6E5F736368656D61 and table_schema! = 0x6D7973716C and table_schema! = 0x706572666F726D616E63655F736368656D61 and (column_name like'% pass%' or column_name like'% pwd%')

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report