what is the significant of state in the severity level error messages?

  • Hi,

      we all know the severity levels from 10 to 24 in the sql server and what is the significant of state in the severity level error messages?

    for eg:   

    Error: 3624, Severity: 20, State: 1

    Error: 9004, Severity: 23, State: 2

    Error: 3624, Severity: 18, State: 3

    Is there is any articles regarding this state info?

    Thanks

     

  • The state info is not defined by SQLServer.  It is used to return state information to the application.  I assume that its use in standard messages would only have value to the SQL Server development team.  You can use this field in custom messages to return state info to your calling app.  A state value of 127 will be used by ISQL and OSQL to set the operating system errorlevel to the error number returned by RAISERROR.  This is quite useful for batch scripting.

    Gordon Pollokoff

    "Wile E. is my reality, Bugs Bunny is my goal" - Chuck Jones

  • Yes, there is actually an article in BOL that might help here:

    Search for "error logs"->"severity levels".

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • Oops, reread your question, I guess, you already know this article

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply