Skip to content

Instantly share code, notes, and snippets.

@maxkoshevoi
Created October 9, 2019 20:08
Show Gist options
  • Save maxkoshevoi/e0a254a25025c9d59a3efd940c9b01f3 to your computer and use it in GitHub Desktop.
Save maxkoshevoi/e0a254a25025c9d59a3efd940c9b01f3 to your computer and use it in GitHub Desktop.
Search for column with specific name in MSSQL database
SELECT c.name AS 'ColumnName'
,t.name AS 'TableName'
FROM sys.columns c
JOIN sys.tables t ON c.object_id = t.object_id
WHERE c.name LIKE '%email%'
ORDER BY TableName
,ColumnName;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment