THROW - 1

  • Comments posted to this topic are about the item THROW - 1

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • Thanks Ron for another one on SQL-2012.

    Need to do a bit of reading to answer this (example [A] in BOL was sufficient to provide necessary hints) 🙂

    ~ Lokesh Vij


    Guidelines for quicker answers on T-SQL question[/url]
    Guidelines for answers on Performance questions

    Link to my Blog Post --> www.SQLPathy.com[/url]

    Follow me @Twitter

  • how should I say it ?? :w00t:

    I got that right ..was caught up for a while in severity level , as in msdn , when Throw used without parameters, the level suggested 14 ..

    and what a well formed questiion

    "The user defined error message 55555 does NOT exist in sys.messages"

    --(you were thinking it :-P)

    well, learned something ..

    thanks for the question ...

    ~ demonfox
    ___________________________________________________________________
    Wondering what I would do next , when I am done with this one :ermm:

  • Great question Ron, thanks!

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • After reading BOL twice, Got some knowledge about it ..

    I'm slightly confused with Level mentioned in example B (BOL) . But anyway I managed get it correct..

    --
    Dineshbabu
    Desire to learn new things..

  • Hi,

    i am not sure about correct answer. When i execute this T-sql in Sql server 2012.

    It shows Level 14 ,State 1 and message = "why oh why do you do this".

    When i check BOL, it's showing "The severity is set to 16."

    Can someone make it clear that why my answer is incorrect ?

    Thanks

    Vinay Kumar

    Thanks
    Vinay Kumar
    -----------------------------------------------------------------
    Keep Learning - Keep Growing !!!

  • This was removed by the editor as SPAM

  • Great question, thanks!

    😀

  • Can anyone please explain about the error level 14 and 16. I am not able to understand this

  • oh if only we had 2012 :'( lol 😛

    got 2 out of 3 right guesing after googling how THROW works :w00t:

    good question and well written 😛

    Regards
    ld

    Stoke-on-Trent
    United Kingdom

    If at first you don't succeed, go to the pub and drink away your current thought plan.

  • Nice interesting question.

    I really must upgrade and get SQL2012 so that I can start playing with this stuff instead of just reading about it.

    If people have run the code and got 14 for erros state, what's going on? I would expect to see 14 only if THROW was called without any parameters (to rethrow the previous error).

    Tom

  • L' Eomot Inversé (2/20/2013)


    Nice interesting question.

    I really must upgrade and get SQL2012 so that I can start playing with this stuff instead of just reading about it.

    + 1

    Thanks for the question on a 2012 feature.



    Everything is awesome!

  • L' Eomot Inversé (2/20/2013)


    Nice interesting question.

    I really must upgrade and get SQL2012 so that I can start playing with this stuff instead of just reading about it.

    If people have run the code and got 14 for erros state, what's going on? I would expect to see 14 only if THROW was called without any parameters (to rethrow the previous error).

    I think people said they got severity level 14, not error state 14. They must be looking at the results of the SELECT in the CATCH block, which does show Level = 14, rather than the error message returned by the THROW statement, which always shows "Level 16" as its defined behavior.

    Jason Wolfkill

  • Awesome, thanks for the question on new 2012 functionality.

  • I'm having a senior blonde moment here...

    What is the difference between:

    THROW returns the same error message as the select statement

    and

    THROW returns the error message "why oh why do you do this"

Viewing 15 posts - 1 through 15 (of 26 total)

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