Link to home
Start Free TrialLog in
Avatar of noulouk
noulouk

asked on

Error number listing

Hi Experts,

I try to catch errors from Sql Server 2005 and find that error number:2627 is "Violation of unique constraint".
Where can I find all other code numbers ?
I need "Violation of unique index" code in particular.
Can I set my  own code without override system codes ?

Thanks in advance for your help.
ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>>Can I set my  own code without override system codes ?<<
You can add custom message.  Is that what you mean?  If so check out sp_addmessage in BOL
Avatar of noulouk
noulouk

ASKER

Thanks that helps me very much.
I found 15306 error codes from 21 to 33020.
I mean when I use RAISERROR: can I send the custom error "100001" ?
So, my own errors starts from 100001 to the last int number.

Don't you do like this to catch your error instead of parsing the RAISERROR message string ?
>>Don't you do like this to catch your error instead of parsing the RAISERROR message string ?<<
No, I do not use custom messages.  I rely on my front-end app to handle that.
Avatar of noulouk

ASKER

Sorry, but I don't understand what you mean:
"I rely on my front-end app to handle that." (do you use a RETURN VALUE ?)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial