Solved

Error number listing

Posted on 2007-03-26
6
3,263 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

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…
I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

636 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