raiserror level

  • Goood question, thanks Steve.

    I might have been better to reference BOL's Database Engine Error Severities page as well as the raiserror page, as that might also provide people to use severities in range 11 to 16 in such a way as to conform to Microsoft's recommendations for those severities.

    Tom

  • Steve Jones - SSC Editor (10/2/2014)


    Note that THROW works well in some cases, RAISERROR in others.

    Learn how to use both.

    It is worth noting that the THROW "message" is fixed to severity 16, doesn't support printf type functionality and is SQL Server 2012 and later.

    😎

  • Eirikur Eiriksson (10/3/2014)


    Steve Jones - SSC Editor (10/2/2014)


    Note that THROW works well in some cases, RAISERROR in others.

    Learn how to use both.

    It is worth noting that the THROW "message" is fixed to severity 16, doesn't support printf type functionality and is SQL Server 2012 and later.

    😎

    I guess that indicates that Microsoft had learnt from RAISERROR, and the lesson was that they shouldn't give users access to severitys 11 to 15 because they would just misuse them. They had left scope for RAISERROR to be abused, but why make the same mistake with THROW? :unsure:

    Tom

  • TomThomson (10/4/2014)


    Eirikur Eiriksson (10/3/2014)


    Steve Jones - SSC Editor (10/2/2014)


    Note that THROW works well in some cases, RAISERROR in others.

    Learn how to use both.

    It is worth noting that the THROW "message" is fixed to severity 16, doesn't support printf type functionality and is SQL Server 2012 and later.

    😎

    I guess that indicates that Microsoft had learnt from RAISERROR, and the lesson was that they shouldn't give users access to severitys 11 to 15 because they would just misuse them. They had left scope for RAISERROR to be abused, but why make the same mistake with THROW? :unsure:

    Must admit that I have always struggled with the concept of a user correctable error in this context.

    😎

  • Good one ...

  • Gr8 question, very informative, thanx.

Viewing 6 posts - 16 through 20 (of 20 total)

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