Solved

Error number listing

Posted on 2007-03-26
6
3,262 Views
Last Modified: 2008-01-09
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.
0
Comment
Question by:noulouk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 250 total points
ID: 18796708
SELECT * FROM master..sysmessages WHERE description LIKE '%violation%'

>Can I set my  own code without override system codes ?
No
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 18796830
>>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
0
 
LVL 9

Author Comment

by:noulouk
ID: 18798212
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 ?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 18800301
>>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.
0
 
LVL 9

Author Comment

by:noulouk
ID: 18804543
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 ?)
0
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 250 total points
ID: 18804723
That is one option, although somewhat limited.  An output varchar parameter can return the error message.
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question