SQL Query of the Day #301220131638

Query:

SELECT t.name AS TableName,
SCHEMA_NAME(schema_id) AS SchemaName,
c.name AS ColumnName
FROM sys.tables AS t
INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID
WHERE c.name LIKE '%Hi-Keeba%'
ORDER BY SchemaName, TableName

Function: Finds any value in any column in any table in a database.

Source: *sigh* …. I honestly don’t remember.

Comments: If you’re dealing with an enormous industrial-strength data jackhammer with hundreds of tables and millions of rows, this query can take a while to run. But you might have to use it.

Leave a Comment

Filed under Uncategorized

Leave a Reply