April 15, 2009 at 11:20 pm
Comments posted to this topic are about the item Error Severity
---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
April 16, 2009 at 12:55 am
20-25
Indicate system problems and are fatal errors, which means that the Database Engine task that is executing a statement or batch is no longer running. The task records information about what occurred and then terminates. In most cases, the application connection to the instance of the Database Engine may also terminate. If this happens, depending on the problem, the application might not be able to reconnect.
Error messages in this range can affect all of the processes accessing data in the same database and may indicate that a database or object is damaged. Error messages with a severity level from 19 through 25 are written to the error log.
http://msdn.microsoft.com/en-us/library/ms164086.aspx">
http://msdn.microsoft.com/en-us/library/ms164086.aspx
Am I confused or What...?
April 16, 2009 at 1:04 am
Hello Atif,
Here you can find another controversial link which says that severity level of messages between 1 and 25.
http://msdn.microsoft.com/en-us/library/ms187382.aspx
Yes it's confusing. 🙁
---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
April 16, 2009 at 1:31 am
Here you can find another controversial link which says that severity level of messages between 1 and 25.
Thats true, but what I pasted in my last post is from the same link provided in the Referance of the Naswer of the Question.
I think I am missing something...
April 16, 2009 at 1:53 am
Ok, I had it wrong.
No big deal but of course I investigated this issue a little more. I'm using SQL 2008 Build 1600, so no SP1.
Obviously what's in BOL is not always correct so I didn't even bother to check.
First I had a look at the options when creating an alert. There you can create alerts for severities 1 to 25. Hmmm???
The I did a query on sys.messages and yes, sys.messages only contains messages with severity 0 and 10 - 24.
So the answer given seems to be correct.
But then I created a new message
EXEC sp_addmessage 50001,25,N'Test Message'
And yes it worked.
So I would say the correct answer is 0 - 25, unless this has been changed in SP1.
Which btw still means my answer was wrong.
[font="Verdana"]Markus Bohse[/font]
April 16, 2009 at 2:45 am
0 to 24 is definitely WRONG!
Just try the following statement:
RAISERROR ('Test Message', 25, 1) WITH LOG
and the result will be an error with severity level 25. (You may even use any level higher than 25 and get the same result.)
Best regards,
Dietmar Weickert.
April 16, 2009 at 3:13 am
Correct answer is 1-25:
exec sp_helptext sp_addmessage
in the output search for @severity and you'll find this piece of code that is the law.
-- Valid severity range for user defined messges is 1 to 25.
if @severity not between 1 and 25
begin
raiserror(15041,-1,-1)
return (1)
end
April 16, 2009 at 3:16 am
I think the confusion is related to the fact that you cannot use severity level 0 for use in sysmessages.
- Severity Levels that can be specified with RAISERROR range from 0 to 25
- Severity Levels for user defined messages to be added to sysmessages range from 1 to 25
And although severity level 25 is not explained like the others (as to what type of error this covers), it does exist and can be tested with RAISERROR('Test', 25,0) WITH LOG
Best Regards,
Chris Büttner
April 16, 2009 at 3:18 am
Carlo Romagnano (4/16/2009)
Correct answer is 1-25:exec sp_helptext sp_addmessage
in the output search for @severity and you'll find this piece of code that is the law.
-- Valid severity range for user defined messges is 1 to 25.
if @severity not between 1 and 25
begin
raiserror(15041,-1,-1)
return (1)
end
No, 0-25 is correct. The fact that you cannot use 0 for sysmessages does not mean the severity level does not exist.
Best Regards,
Chris Büttner
April 16, 2009 at 3:30 am
Christian Buettner (4/16/2009)
Carlo Romagnano (4/16/2009)
Correct answer is 1-25:exec sp_helptext sp_addmessage
in the output search for @severity and you'll find this piece of code that is the law.
-- Valid severity range for user defined messges is 1 to 25.
if @severity not between 1 and 25
begin
raiserror(15041,-1,-1)
return (1)
end
No, 0-25 is correct. The fact that you cannot use 0 for sysmessages does not mean the severity level does not exist.
I agree with Christoph,
0 to 25 should be the corrct number. Even though you cannot create a custom message with severity level 0, the fact that sys.messages contain more than a hundred message_id's with severity 0 prives enough I think.
Anyway now this discussion has been started I had another good look at the question.
"In SQL Server 2008 what is the range of severity levels?"
Maybe the question should be "What is the range of severity levels for system messages ? (0-24)"
[font="Verdana"]Markus Bohse[/font]
April 16, 2009 at 4:31 am
"0-25", Thats what I think and thats what I answered. But didn't get the score...:-D
April 16, 2009 at 5:27 am
Agreed, the answer should definitely be 0 to 25 for the reasons already given
April 16, 2009 at 5:38 am
Carlo Romagnano (4/16/2009)
Correct answer is 1-25:exec sp_helptext sp_addmessage
in the output search for @severity and you'll find this piece of code that is the law.
-- Valid severity range for user defined messges is 1 to 25.
if @severity not between 1 and 25
begin
raiserror(15041,-1,-1)
return (1)
end
I have read (somewhere) that users can create messages with error severity from 1-25. However, the database engine itself can send a severity of 0. Therefore, the correct answer is 0-25.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
April 16, 2009 at 5:58 am
Run this query on 2008 and tell me what you get back:
SELECT MIN(severity),MAX(severity)
FROM sys.sysmessages;
That will give you your answer. Hint: 0 and 24. It's the same for RTM or SP1.
Cheers,
Brian
April 16, 2009 at 6:01 am
Hello,
My intention to post this question was to makes things clear.
I do agree 0-25 is correct Answer.
At the time of posting question I have executed
select * from sysmessages where severity = 25 in sql server 2000 and sql server 2008 (sys.messages) and found that there are 3 entry in sql server 2000 and no entry in 2008. Hence opted for 0-24.
Also ambiguity in BOL make me confused.
I thank you all of you for clarifying the same.
Appology for not scoring a point for correct answer. :pinch:
---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
Viewing 15 posts - 1 through 15 (of 22 total)
You must be logged in to reply to this topic. Login to reply