• wolfkillj (2/20/2013)


    batgirl (2/20/2013)


    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"

    The SELECT statement returns one row with four columns. The value in the unnamed fourth column is the text returned by the ERROR_MESSAGE() function, i.e., the standard "violation of primary key" message.

    The THROW statement doesn't return rows but generates a message that includes the string 'why oh why do you do this', which was the [message] argument to the THROW statement.

    THROW therefore does not return the same "error message" as the SELECT, but does return "why oh why do you do this".

    Does that clear it up?

    Yes - I was woefully short on caffeine when I wondered this.

    Some days "senior" and "blonde" is an insurmountable combination 😀

    Thanks so much!