Error Severity

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

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

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

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

  • 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
    [font="Arial Black"]here[/font][/url][/right]

  • 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]

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

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

  • 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

  • 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]

  • "0-25", Thats what I think and thats what I answered. But didn't get the score...:-D

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • Agreed, the answer should definitely be 0 to 25 for the reasons already given

  • 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


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • 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

  • 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