• 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