title: Error handler for insert into before deleting the records
body: <p>I have SQL Server table with application and push the data to oracle table (3rd party) using link-server. I want to set an error handler if insertion is not successful the delete query will not be executed. Here's my query run in SQL Server Agent every 24 hours.</p>
  <pre><code>DELETE FROM oracle_tbl
  </code></pre>
  <p>--If insert into is not successful then rollback else commit--</p>
  <pre><code>INSERT INTO oracle_tbl
  SELECT*
  FROM
  sqlserver_tbl
  </code></pre>