Find tables with specific column name in SQL Server database

Query below finds all tables that have 'ProductID' column.

See also tables that don't have a column with specific name.


select schema_name(t.schema_id) as schema_name, as table_name
from sys.tables t
where t.object_id in 
    (select c.object_id 
      from sys.columns c
     where = 'ProductID')
order by schema_name,


  • schema_name - name of schema of found table
  • table_name - name of found table


  • One row represents a table
  • Scope of rows: all found tables
  • Ordered by schema name

Sample results

List of tables that have 'ProductID' column.

There are no comments. Click here to write the first comment.