Skip to content

Instantly share code, notes, and snippets.

@costr
Last active May 3, 2021 15:46
Show Gist options
  • Save costr/9c7785fbde64c7193e353171c0ab9c39 to your computer and use it in GitHub Desktop.
Save costr/9c7785fbde64c7193e353171c0ab9c39 to your computer and use it in GitHub Desktop.
Find SQL Table by Column Name
SELECT
COLUMN_NAME AS 'ColumnName'
,TABLE_SCHEMA AS 'TableSchema'
,TABLE_NAME AS 'TableName'
FROM
INFORMATION_SCHEMA.COLUMNS
WHERE
COLUMN_NAME LIKE '%COLUMN_NAME_HERE%' -- <-- REPLACE COLUMN FILTER
ORDER BY
TableSchema
,TableName
,ColumnName;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment