title: Sql server DELETE and WITH clause
body: <p>I need to build an SQL statement to delete from certain table the records that match another select statement. </p>
  
  <p>In Teradata we use </p>
  
  <pre><code>delete from table1 
  where (col1, col2) in (
    select col1,col2
    from table2
  )
  </code></pre>
  
  <p>While in SQL Server it's not allowed to have more than 1 column in the WHERE..IN clause. I thought I can use the WITH clause:</p>
  
  <pre><code>with tempTable(col1,col2) as (
  select col1,col2
  from table2
  )
  delete from table1
  where table1.col1 = tempTable.col1
  and table1.col2 = tempTable.col2
  </code></pre>
  
  <p>How to use WITH..DELETE clause? Is there another way?</p>