Find tables with column

Last modified 1 year ago
Danger icon
The last modifications of this post were around 1 year ago, some information may be outdated!

Summary

If you don't remember the table name, but remember the column name, use this script to find it.

Code

SELECT c.name AS ColName, t.name AS TableName
FROM sys.columns c
JOIN sys.tables t ON c.object_id = t.object_id
WHERE c.name LIKE '%MyCol%';