/ Published in: SQL

Find column name in all tables of a database
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
SELECT t.name AS TABLE_NAME, SCHEMA_NAME(schema_id) AS schema_name, c.name AS column_name FROM sys.tables AS t INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID WHERE c.name LIKE '%EmployeeID%' ORDER BY schema_name, TABLE_NAME;
Comments
