Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 123»»»

Error Severity Expand / Collapse
Author
Message
Posted Wednesday, April 15, 2009 11:20 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, July 21, 2014 2:56 AM
Points: 2,603, Visits: 2,061
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."
Post #698149
Posted Thursday, April 16, 2009 12:55 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Saturday, November 29, 2014 3:55 PM
Points: 3,244, Visits: 5,010

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



Am I confused or What...?


----------------------------------------------------------------------------------------------------------------------------------------------------------------------

Sometimes, winning is not an issue but trying.

You can check my BLOG here

Post #698189
Posted Thursday, April 16, 2009 1:04 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, July 21, 2014 2:56 AM
Points: 2,603, Visits: 2,061
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."
Post #698190
Posted Thursday, April 16, 2009 1:31 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Saturday, November 29, 2014 3:55 PM
Points: 3,244, Visits: 5,010

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...



----------------------------------------------------------------------------------------------------------------------------------------------------------------------

Sometimes, winning is not an issue but trying.

You can check my BLOG here

Post #698200
Posted Thursday, April 16, 2009 1:53 AM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Tuesday, December 9, 2014 5:31 AM
Points: 4,429, Visits: 4,183
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.


Markus Bohse
Post #698207
Posted Thursday, April 16, 2009 2:45 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, August 28, 2014 7:17 AM
Points: 1,608, Visits: 374
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.
Post #698222
Posted Thursday, April 16, 2009 3:13 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 12:49 AM
Points: 2,620, Visits: 2,467
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
Post #698234
Posted Thursday, April 16, 2009 3:16 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, October 7, 2014 2:56 AM
Points: 2,842, Visits: 3,876
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
Post #698238
Posted Thursday, April 16, 2009 3:18 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, October 7, 2014 2:56 AM
Points: 2,842, Visits: 3,876
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
Post #698239
Posted Thursday, April 16, 2009 3:30 AM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Tuesday, December 9, 2014 5:31 AM
Points: 4,429, Visits: 4,183
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)"



Markus Bohse
Post #698249
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse