title: How to query for columns in sql database
body: <p>I am merging a few tables and I need to query for specific column names. Reason being these tables I am condensing have FK candidate columns but no FK so I would have to keep looking through every table to see if it contained a specific column name and that seems to be wearing on the eyes a little.</p>
  
  <p>I got this from another post but it is not complete.</p>
  
  <pre><code>SELECT 'SELECT ''' + TABLE_NAME + '.' + column_name + 
     ''' FROM ' + TABLE_NAME + ' WHERE ' + 
     column_name + ' = ''[THE COLUMN NAME I AM LOOKING FOR]'''
  FROM INFORMATION_SCHEMA.COLUMNS 
  </code></pre>
  
  <p>The TSQL above seems to not be structured correctly or I am missing something.</p>