Solved

SQL Server Severity - Raiserror vs sp_addmessage

Posted on 2002-03-19
4
1,214 Views
Last Modified: 2008-01-09
sp_addmessage allows one to optionally specify an error severity level, RAISERRROR requires it.  I don't
see what the point of assigning a severity level when using sp_addmessage, because I'm going to have
to specify it again when using RAISERROR as it is oblivious to the error numbers assocated severity
level.

The only way it makes sense to me is that before I use a custom error message that I query the sysmessages
table to see what severity level was used when the message was added, then use that severity level in
the RAISERROR call.  Am I missing something?  Do people actually use severity level this way?
0
Comment
Question by:dancebert
[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
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
vindevogel earned 200 total points
ID: 6880548
Setting the Severity Level, either completely stops your SP without even considering the next line (which could have been a RETURN @)

Somebody even told me that if you set the severity high enough, it stops the sql server.

That's what I made of it
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7634168
Hi dancebert@pcsupport,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept vindevogel's comment(s) as an answer.

dancebert@pcsupport, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 4

Expert Comment

by:vindevogel
ID: 7648126
DanRollings, thanks for interfering.

Dancebert:

First of all, you post a question hoping to get help fast.  I gave you a (possible) answer after an hour and a half.  I consider this pretty fast.

You abondon the question without further notice.

Some people, like I, are not here for earning money or so.  We like to help.  Therefore, we als like some appreciation.
You have graded me with the lowest grade possible.  This is to me a sign of disrespect.

DanRollings: could you please delete this question from me scoreboard.  This is a blame on the other 110 questions I solved on EE.

Thanks.
0
 
LVL 9

Author Comment

by:dancebert
ID: 7653723
vindevogel's comment, that setting severity level stops the SP, is true.  It also has very little to do with the question I asked.  The second line of my question was: "I don't see what the point of assigning a severity level when using sp_addmessage, because I'm going to have
to specify it again when using RAISERROR.."  

I wasn't asking what a severity level did, I was asking why would anyone use it as an optional parameter to sp_addMessage.  My guess is that vindevogel was unable to see the distinction because of his limited command of the english language.

The question wasn't answered.  I accepted his comment as a answer just to close the books on this.

0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month6 days, 8 hours left to enroll

634 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