sql raiseerror error.number wrong in VB

Posted by Melody Friedenthal on Stack Overflow See other posts from Stack Overflow or by Melody Friedenthal
Published on 2010-04-29T15:50:39Z Indexed on 2010/04/29 16:07 UTC
Read the original article Hit count: 500

Filed under:
|

I wrote a T-SQL query which includes a test for valid EmployeeNo. If the EmployeeNo is not valid, I do the following:

RAISERROR(5005, 10, 1, N'Invalid Employee No')
return @@Error

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.

What is the explanation for this?

Thank you.

© Stack Overflow or respective owner

Related posts about tsql

Related posts about raiserror