<p>I have a large database and would like to select table names that have a certain column name. I have done something like this in MySQL, but can't find any info on SQL Server.</p>

<p>I want to do something like:</p>

<pre><code>select [table] 
from [db] 
where table [has column 'classtypeid']
</code></pre>

<p>How can I do something like this?</p>

[{'answer_id': 28008, 'author': 'SQLMenace', 'author_id': 740, 'author_profile': 'https://Stackoverflow.com/users/740', 'pm_score': 4, 'selected': True, 'text': "<p>Use the ANSI information_schema views, this will also work in MySQL</p>\n\n<pre><code>select table_name \nfrom information_schema.columns \nwhere column_name = 'classtypeid'\n</code></pre>\n"}, {'answer_id': 28012, 'author': 'Lasse V. Karlsen', 'author_id': 267, 'author_profile': 'https://Stackoverflow.com/users/267', 'pm_score': 2, 'selected': False, 'text': "<p>Here you go:</p>\n\n<pre><code>SELECT C.TABLE_NAME\nFROM INFORMATION_SCHEMA.COLUMNS AS C\n  INNER JOIN INFORMATION_SCHEMA.TABLES AS T ON C.TABLE_NAME = T.TABLE_NAME\n    AND C.TABLE_SCHEMA = T.TABLE_SCHEMA\nWHERE C.COLUMN_NAME = 'classtypeid'\n  AND T.TABLE_TYPE = 'BASE TABLE'\n</code></pre>\n\n<hr>\n\n<p><strong>Edit</strong>: Note that this will not list views based on any tables with that column. If you only query INFORMATION_SCHEMA.COLUMNS you will also get back views.</p>\n"}]
['https://Stackoverflow.com/questions/28003', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1638/']