Skip to content

Instantly share code, notes, and snippets.

@oskarnrk
Created October 11, 2018 09:38
Show Gist options
  • Save oskarnrk/7713678ac8a622108c8a6a533759fa62 to your computer and use it in GitHub Desktop.
Save oskarnrk/7713678ac8a622108c8a6a533759fa62 to your computer and use it in GitHub Desktop.
Search which tables or views have a column by name
SELECT COLUMN_NAME AS 'ColumnName'
,TABLE_NAME AS 'TableName'
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME LIKE '%MyName%'
ORDER BY TableName
,ColumnName;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment