title: How do I delete Columns from a table if not another table using SQL?
body: <p>Let's say</p>
  
  <p>Table1 has columns: Column1 Column2 Column3</p>
  
  <p>Table2 has columns: Column2 Column3 Column4</p>
  
  <p>I want Column1 to be deleted because it's not in Table2.</p>
  
  <p>I am guessing I need to a JOIN and then delete from that.  I did some searching and found this article:
  <a href="https://stackoverflow.com/questions/1054984/how-can-i-get-column-names-from-a-table-in-sql-server">How can I get column names from a table in SQL Server?</a></p>
  
  <p>I tried:</p>
  
  <pre class="lang-sql prettyprint-override"><code>    SELECT   T.TABLE_NAME AS 'TABLE NAME',
               C.COLUMN_NAME AS 'COLUMN NAME'
      FROM     INFORMATION_SCHEMA.TABLES T
         INNER JOIN INFORMATION_SCHEMA.COLUMNS C ON
               T.TABLE_NAME=C.TABLE_NAME
      WHERE    T.TABLE_TYPE='BASE TABLE'
      AND      T.TABLE_NAME LIKE 'T'
  </code></pre>
  
  <p>but I can only get the Column names to show for one Table.  I tried modifying it with no luck, and of course I need to delete as well.  Even if I could get a list of columns that don't match would help.  I am no SQL expert but that's as far as I got.  Any help would be appreciated.  Thanks!</p>