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