Find all tables containing column with specified name - MS SQL Server - Stack Overflow

PHOTO EMBED

Thu Feb 03 2022 12:39:10 GMT+0000 (UTC)

Saved by @paulbarry #sql

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 '%MyName%'
ORDER BY    TableName
            ,ColumnName;
content_copyCOPY

https://stackoverflow.com/questions/4849652/find-all-tables-containing-column-with-specified-name-ms-sql-server