title: sql raiseerror error.number wrong in VB
body: <p>I wrote a T-SQL query which includes a test for valid EmployeeNo. If the EmployeeNo is not valid, I do the following:</p>
  
  <pre><code>RAISERROR(5005, 10, 1, N'Invalid Employee No')
  return @@Error
  </code></pre>
  
  <p>Back in VB.Net I test the sql exception and found that when the Employee No is invalid the error.number is not 5005 as I would expect, but 2732.</p>
  
  <p>What is the explanation for this?</p>
  
  <p>Thank you.</p>