Find Column Name in all tables in a Database


/ Published in: SQL
Save to your folder(s)

Find column name in all tables of a database


Copy this code and paste it in your HTML
  1. SELECT t.name AS TABLE_NAME,
  2. SCHEMA_NAME(schema_id) AS schema_name,
  3. c.name AS column_name
  4. FROM sys.tables AS t
  5. INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID
  6. WHERE c.name LIKE '%EmployeeID%'
  7. ORDER BY schema_name, TABLE_NAME;

Report this snippet


Comments


You need to login to view comments.