title: Multiple statements in SSIS Execute SQL Task
body: <p>In my SSIS package I have an Execute SQL Task with 2 statements. Basically, they are:</p>
  
  <pre><code>INSERT INTO table2 SELECT * FROM table1;
  TRUNCATE TABLE table1
  </code></pre>
  
  <p>First statement failed (duplicate records). But table1 is empty now! Do I misunderstand basic principles of databases?! I expected the whole batch to fail if the first statement failed.</p>
  
  <p>In the execution report there are expected error messages:
  1. Cannot insert duplicate key row.
  2. The statement has been terminated. Possible failure reasons bla-bla </p>
  
  <p>My server is SQL Server 2012 SP2 CU1, OLEDB connection</p>
  
  <p>There are no other truncate statements for this table known to me. Have I gone insane?</p>