title: How to log a stored procedure error
body: <p><strong>Scenario:</strong> C# apps uses SQL2000. It excecute 3 stored procs within a try catch in the app. In the catch the error is suppressed. Due to some legalities, the c# code cannot be changed and implemented. </p>
  
  <p><strong>Q:</strong> How do I trap the actual SQL error in the stored proc into a log file or other table? @@Error returns an error message to the app but when evaluated in query analyzer it is always 0 although the 'If @@Error &lt;> 0' does fire. I try to store the @@Error number, but it is always 0.</p>
  
  <p>Please help.</p>