Find tables with column

Last modified 12 months ago

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%';