Find tables with column

Last modified 2 years ago
Danger icon
The last modifications of this post were around 2 years 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%';