Table filter by column name
Another cool filter would be a filter by column.
Some time happens to ask something like this: "What is the table tha has the column password?" the answere could be "Some tables has it" :).
Is there a way to do something like this? If not, it would be a great feature to implement!
SELECT * FROM information_schema.`COLUMNS` c WHERE c.COLUMN_NAME LIKE '%password%'
Here's a way to query all tables in all databases:
SET NOCOUNT ON
DECLARE @AllTables table (TABLE_CATALOG sysname,TABLE_SCHEMA sysname, TABLE_NAME sysname, COLUMN_NAME sysname)
SET @SQL='SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME FROM [?].information_schema.COLUMNS c WHERE c.COLUMN_NAME LIKE ''%password%'''
INSERT INTO @AllTables (TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME,COLUMN_NAME)
EXEC sp_msforeachdb @SQL
SET NOCOUNT OFF
SELECT * FROM @AllTables ORDER BY TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME,COLUMN_NAME
I vote for this feature. I think on table view in "Data" should be dynamic filter for column name that I can use to fast filter columns. I know there is filter for column but in this case it is unusefull
Nice feature, but for MSSQL: SELECT * FROM INFORMATION_SCHEMA.COLUMNS c WHERE c.COLUMN_NAME LIKE '%password%'
Please login to leave a reply, or register at first.