title: RAISEERROR Date and Time
body: <p>I have long running sql statement inside TRY...CATCH.</p>
  
  <pre><code>BEGIN CATCH
      DECLARE @ErrorMsg = ERROR_MESSAGE(),@ErrSevirity = Error_Sevirity()
      RAISEERROR(@ErrorMsg , @ErrSevirity , 1)     
      --do rollback
  END CATCH
  </code></pre>
  
  <p>I know what time The stored procedure failed, How do I get the the error message? sysmessages doesn't have date time field,is there any way I can join it to other table to get Error Date and Time?</p>
  
  <pre><code>select * from master.dbo.sysmessages
  </code></pre>