title: Using @@error and @@rowcount in stored procedures
body: <p>My stored procedure accepts <code>xml</code> data, the number of rows that can be generated from this <code>xml</code> data is unknown forehand. </p>
  
  <p>In this I need to handle transactions when saving this <code>xml</code> data to a table. I cannot use <code>@@rowcount</code> to check whether the insert is successful because all rows in the <code>xml</code> are inserted at once. Therefore the only option I have is <code>@@error</code>. Assume the <code>xml</code> contains 10 rows of data, if one record failed to insert would <code>@@error</code> detect it?</p>
  
  <p>Thanks</p>