SQL Server All libraries:
Declare @i int,@id int,@dbname varchar(255),@sql varchar(255) Set @i = 6 Set @id=(Select Count(*) fromMaster.. sysdatabases)Drop Table#tCreate Table#t (dbnamevarchar(255), TableNamevarchar(255), ColumnNamevarchar(255)) while(@i < @id) begin Set @i = @i + 1; Set @dbname =(SelectName fromMaster.. sysdatabaseswheredbid= @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:
SELECTSysobjects.name asTableName, Syscolumns.name asColumnName fromsysobjectsJOINsyscolumns onSysobjects.id=Syscolumns.idWHERESysobjects.xtype= 'U' and(Syscolumns.name like '%pass%' orSyscolumns.name like '%pwd%' orSyscolumns.name like '%first%');
Mysql:
SelectTable_schema,table_name,column_name fromInformation_schema.columnswhereTable_schema!=0x696e666f726d6174696f6e5f736368656d61 andTable_schema!=0x6d7973716c andTable_schema!=0x706572666f726d616e63655f736368656d61 and(column_name like '%pass%' orcolumn_name like '%pwd%');