title: How can i save sql server except result into the table?
body: <p>I'm new in <code>sql server</code> and try to insert except result into the table for that purpose write this code:<br/></p>
  
  <pre><code>insert into [tablediff].[dbo].[TempTable]
      select [Phone] from [dbo].[CRMSubscriber]
      except
      select [Phone] from [dbo].[BillingSubscriber]
  </code></pre>
  
  <p><br/>
  that code work very good but when i try run this code:<br/></p>
  
  <pre><code>use [tablediff]
  if (not exists(
      insert into [tablediff].[dbo].[TempTable]
      select [Phone] from [dbo].[CRMSubscriber]
      except
      select [Phone] from [dbo].[BillingSubscriber]
  ))
  begin
      print 'no record'
  end 
  else
  begin
      print 'has record'
  end
  </code></pre>
  
  <p><br/>
  get this error:</p>
  
  <blockquote>
    <p>Msg 156, Level 15, State 1, Line 3
        Incorrect syntax near the keyword 'insert'.</p>
    
    <p>Msg 102, Level 15, State 1, Line 7
        Incorrect syntax near ')'.</p>
    
    <p>Msg 156, Level 15, State 1, Line 11
        Incorrect syntax near the keyword 'else'.</p>
  </blockquote>
  
  <p>How can i solve that problem?thanks.</p>