ANSI_NULLS

  • RBarryYoung (4/7/2010)


    the error message 'a domain error has occurred'

    AFAIK SQRT, LOG and maybe POWER are the only things that return this error.

    I vote for this list: SQRT, LOG, LOG10, POWER, ACOS, ASIN, and COT.

    Can someone add something to this list? 🙂

  • RBarryYoung (4/7/2010)


    Paul:

    Now I'm curious to know how you did on mine...? (here: http://www.sqlservercentral.com/questions/T-SQL/63632/) Its still got one of the lowest correct percentages that I know of.

    That was a great question indeed, as is this one from Paul. And though I got Paul's question right (bit of luck!), I'll admit that I was in the majority that replied wrong to RBarry's question.

    But one of the lowest correct percentages that you know of? I don't think so!

    http://www.sqlservercentral.com/questions/Design+and+Theory/64698/[/url] - 37%

    http://www.sqlservercentral.com/questions/SQL+Server+2008/63588/[/url] - 35%

    http://www.sqlservercentral.com/questions/Design+and+Theory/64304/[/url] - 20%

    http://www.sqlservercentral.com/questions/Administration/67278/[/url] - 16%

    http://www.sqlservercentral.com/questions/Administration/67277/[/url] - 15%

    And I've got two new questions lined up; they are scheduled for April 20th and May 6th. I don't think they're quite as hard as the last three from this list, though.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/

  • Hugo Kornelis (4/8/2010)


    ...hard question list...

    I got all those questions wrong - except the 15% one :blink:

    And I've got two new questions lined up; they are scheduled for April 20th and May 6th. I don't think they're quite as hard as the last three from this list, though.

    Looking forward to it.

  • Paul White NZ (4/8/2010)


    Hugo Kornelis (4/8/2010)


    ...hard question list...

    I got all those questions wrong - except the 15% one :blink:

    So that means you learned something new from four out of those five questions. Good. Goal accomplished 😉


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/

  • RBarryYoung (4/7/2010)


    Paul White NZ (4/7/2010)


    RBarryYoung (4/7/2010)


    Yup, AFAIK SQRT, LOG and maybe POWER are the only things that return this error.

    Ooo - I had never tried POWER. Have now, and you're right - though POWER (0, -1) gives me a divide-by-zero, rather than a domain error or invalid floating point operation.

    Yeah, there's just so many reasons that ones wrong, it's hard to pick just one. Almost as bad as POWER(0, 0). 😀

    :-DWhat do you want it to do?

    Do you want it to

    (a) return 0 so that f(x) = POWER (x,0) has a discontinuity at x = 0 while g(x) = POWER(0,x) is continuous everywhere (ie invert the current situation) or

    (b) return NaN so that both functions are "undefined" at x=0 (but that requires support for the IEEE standard in SQLS, which hasn't yet happened: see http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=239674) or

    (c) return a domain error (so that both functions are "undefined" in such a way that no programmer can deal with it and must always test for the special case) or

    (d) return two different catchable errors from POWER(0,X) (one for x < 0, another for x=0)

    ??

    For me, (b) is the only useful approach, but note that this requires in addition a catchable error to handle attempts to insert NaNs into an index column (since such columns can allow NaN no more than they can allow NULL).

    Tom

  • Hugo Kornelis (4/8/2010)


    But one of the lowest correct percentages that you know of? I don't think so!

    And I've got two new questions lined up; they are scheduled for April 20th and May 6th. I don't think they're quite as hard as the last three from this list, though.

    I managed to get three of the 5 wrong:crying:.

    I hope to do better :unsure:on your next two.

    Tom

  • vk-kirov (4/8/2010)


    RBarryYoung (4/7/2010)


    the error message 'a domain error has occurred'

    AFAIK SQRT, LOG and maybe POWER are the only things that return this error.

    I vote for this list: SQRT, LOG, LOG10, POWER, ACOS, ASIN, and COT.

    Can someone add something to this list? 🙂

    Seems to be a complete list! Well done.

  • Hugo Kornelis (4/8/2010)


    Paul White NZ (4/8/2010)


    Hugo Kornelis (4/8/2010)


    ...hard question list...

    I got all those questions wrong - except the 15% one :blink:

    So that means you learned something new from four out of those five questions. Good. Goal accomplished 😉

    In reference to those five questions, I learned something from each of them - not to say that I missed them all though.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • CirquedeSQLeil (4/8/2010)


    Hugo Kornelis (4/8/2010)


    Paul White NZ (4/8/2010)


    Hugo Kornelis (4/8/2010)


    ...hard question list...

    I got all those questions wrong - except the 15% one :blink:

    So that means you learned something new from four out of those five questions. Good. Goal accomplished 😉

    In reference to those five questions, I learned something from each of them - not to say that I missed them all though.

    Thanks, Jason. That is nice feedback to receive! I hope you'll find my two new questions equally educative.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/

  • Hugo Kornelis (4/8/2010)


    CirquedeSQLeil (4/8/2010)


    Hugo Kornelis (4/8/2010)


    Paul White NZ (4/8/2010)


    Hugo Kornelis (4/8/2010)


    ...hard question list...

    I got all those questions wrong - except the 15% one :blink:

    So that means you learned something new from four out of those five questions. Good. Goal accomplished 😉

    In reference to those five questions, I learned something from each of them - not to say that I missed them all though.

    Thanks, Jason. That is nice feedback to receive! I hope you'll find my two new questions equally educative.

    You're welcome.

    Can't wait for the new questions.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Hugo Kornelis (4/8/2010)


    RBarryYoung (4/7/2010)


    Paul:

    Now I'm curious to know how you did on mine...? (here: http://www.sqlservercentral.com/questions/T-SQL/63632/) Its still got one of the lowest correct percentages that I know of.

    That was a great question indeed, as is this one from Paul. And though I got Paul's question right (bit of luck!), I'll admit that I was in the majority that replied wrong to RBarry's question.

    But one of the lowest correct percentages that you know of? I don't think so!

    http://www.sqlservercentral.com/questions/Design+and+Theory/64698/[/url] - 37%

    http://www.sqlservercentral.com/questions/SQL+Server+2008/63588/[/url] - 35%

    http://www.sqlservercentral.com/questions/Design+and+Theory/64304/[/url] - 20%

    http://www.sqlservercentral.com/questions/Administration/67278/[/url] - 16%

    http://www.sqlservercentral.com/questions/Administration/67277/[/url] - 15%

    And I've got two new questions lined up; they are scheduled for April 20th and May 6th. I don't think they're quite as hard as the last three from this list, though.

    Ouch! Me too, except I only got the 35% one right. And I'm concerned :-Dthat the main thing that I may have learned from these was to seriously avoid IGNORE_DUP_KEY. 😀

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • Tom.Thomson (4/8/2010)


    RBarryYoung (4/7/2010)


    Paul White NZ (4/7/2010)


    RBarryYoung (4/7/2010)


    Yup, AFAIK SQRT, LOG and maybe POWER are the only things that return this error.

    Ooo - I had never tried POWER. Have now, and you're right - though POWER (0, -1) gives me a divide-by-zero, rather than a domain error or invalid floating point operation.

    Yeah, there's just so many reasons that ones wrong, it's hard to pick just one. Almost as bad as POWER(0, 0). 😀

    :-DWhat do you want it to do?

    Do you want it to

    (a) return 0 so that f(x) = POWER (x,0) has a discontinuity at x = 0 while g(x) = POWER(0,x) is continuous everywhere (ie invert the current situation) or

    (b) return NaN so that both functions are "undefined" at x=0 (but that requires support for the IEEE standard in SQLS, which hasn't yet happened: see http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=239674) or

    (c) return a domain error (so that both functions are "undefined" in such a way that no programmer can deal with it and must always test for the special case) or

    (d) return two different catchable errors from POWER(0,X) (one for x < 0, another for x=0)

    ??

    For me, (b) is the only useful approach, but note that this requires in addition a catchable error to handle attempts to insert NaNs into an index column (since such columns can allow NaN no more than they can allow NULL).

    I seem to remember an argument made by one of my professors in college that "Zero to the Zeroth power" could be shown to be non-asymptotically discontinuous in an uncountably infinite number of ways and in fact in a transfinite-class number of ways that was at least one transfinite-class higher than that for "0/0". But that's probably too many exceptions to handle in most programs. 😀

    Point being (I guess), that even plain old numerical mathematics theory can never be perfectly mapped/applied to real programming, there's always something that has to be swept under the carpet and just smoothed over for practical purposes. It's the main reason that I get so prickly when Relational Purists start moaning about NULLs in SQL. Heck if even basic arithmetic has to swallow DivideByZero in application, then I think that the Relational Model should be able to survive NULLs. But that's jsut me ... 😀

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • RBarryYoung (4/8/2010)


    Tom.Thomson (4/8/2010)


    RBarryYoung (4/7/2010)


    Paul White NZ (4/7/2010)


    RBarryYoung (4/7/2010)


    Yup, AFAIK SQRT, LOG and maybe POWER are the only things that return this error.

    Ooo - I had never tried POWER. Have now, and you're right - though POWER (0, -1) gives me a divide-by-zero, rather than a domain error or invalid floating point operation.

    Yeah, there's just so many reasons that ones wrong, it's hard to pick just one. Almost as bad as POWER(0, 0). 😀

    :-DWhat do you want it to do?

    Do you want it to

    (a) return 0 so that f(x) = POWER (x,0) has a discontinuity at x = 0 while g(x) = POWER(0,x) is continuous everywhere (ie invert the current situation) or

    (b) return NaN so that both functions are "undefined" at x=0 (but that requires support for the IEEE standard in SQLS, which hasn't yet happened: see http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=239674) or

    (c) return a domain error (so that both functions are "undefined" in such a way that no programmer can deal with it and must always test for the special case) or

    (d) return two different catchable errors from POWER(0,X) (one for x < 0, another for x=0)

    ??

    For me, (b) is the only useful approach, but note that this requires in addition a catchable error to handle attempts to insert NaNs into an index column (since such columns can allow NaN no more than they can allow NULL).

    I seem to remember an argument made by one of my professors in college that "Zero to the Zeroth power" could be shown to be non-asymptotically discontinuous in an uncountably infinite number of ways and in fact in a transfinite-class number of ways that was at least one transfinite-class higher than that for "0/0". But that's probably too many exceptions to handle in most programs. 😀

    Point being (I guess), that even plain old numerical mathematics theory can never be perfectly mapped/applied to real programming, there's always something that has to be swept under the carpet and just smoothed over for practical purposes. It's the main reason that I get so prickly when Relational Purists start moaning about NULLs in SQL. Heck if even basic arithmetic has to swallow DivideByZero in application, then I think that the Relational Model should be able to survive NULLs. But that's jsut me ... 😀

    You raise another quite interesting topic for me. Is 0/0 = 1 or is 0/0 an error?

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • CirquedeSQLeil (4/8/2010)


    RBarryYoung (4/8/2010)


    Tom.Thomson (4/8/2010)


    RBarryYoung (4/7/2010)


    Paul White NZ (4/7/2010)


    RBarryYoung (4/7/2010)


    Yup, AFAIK SQRT, LOG and maybe POWER are the only things that return this error.

    Ooo - I had never tried POWER. Have now, and you're right - though POWER (0, -1) gives me a divide-by-zero, rather than a domain error or invalid floating point operation.

    Yeah, there's just so many reasons that ones wrong, it's hard to pick just one. Almost as bad as POWER(0, 0). 😀

    :-DWhat do you want it to do?

    Do you want it to

    (a) return 0 so that f(x) = POWER (x,0) has a discontinuity at x = 0 while g(x) = POWER(0,x) is continuous everywhere (ie invert the current situation) or

    (b) return NaN so that both functions are "undefined" at x=0 (but that requires support for the IEEE standard in SQLS, which hasn't yet happened: see http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=239674) or

    (c) return a domain error (so that both functions are "undefined" in such a way that no programmer can deal with it and must always test for the special case) or

    (d) return two different catchable errors from POWER(0,X) (one for x < 0, another for x=0)

    ??

    For me, (b) is the only useful approach, but note that this requires in addition a catchable error to handle attempts to insert NaNs into an index column (since such columns can allow NaN no more than they can allow NULL).

    I seem to remember an argument made by one of my professors in college that "Zero to the Zeroth power" could be shown to be non-asymptotically discontinuous in an uncountably infinite number of ways and in fact in a transfinite-class number of ways that was at least one transfinite-class higher than that for "0/0". But that's probably too many exceptions to handle in most programs. 😀

    Point being (I guess), that even plain old numerical mathematics theory can never be perfectly mapped/applied to real programming, there's always something that has to be swept under the carpet and just smoothed over for practical purposes. It's the main reason that I get so prickly when Relational Purists start moaning about NULLs in SQL. Heck if even basic arithmetic has to swallow DivideByZero in application, then I think that the Relational Model should be able to survive NULLs. But that's jsut me ... 😀

    You raise another quite interesting topic for me. Is 0/0 = 1 or is 0/0 an error?

    In arithmetic, it's just "undefined", technically a domain (input) exception, I think. In theoretical mathematics study of such things (Real/Complex Calculus, Real/Complex Analysis, etc.) it's a discontinuity, and a very interesting one at that (and Power(0,0) even more so), because unlike 1/0 you can usually manipulate whatever equation it is embedded in to determine what value it "should" have in that particular case.

    (Note: and now I realize/remember that my previous reply to Tom only makes sense when the expression (0 to the 0th power) is a result returned by an equation...:w00t:)

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • RBarryYoung (4/8/2010)


    Tom.Thomson (4/8/2010)


    RBarryYoung (4/7/2010)


    Paul White NZ (4/7/2010)


    RBarryYoung (4/7/2010)


    Yup, AFAIK SQRT, LOG and maybe POWER are the only things that return this error.

    Ooo - I had never tried POWER. Have now, and you're right - though POWER (0, -1) gives me a divide-by-zero, rather than a domain error or invalid floating point operation.

    Yeah, there's just so many reasons that ones wrong, it's hard to pick just one. Almost as bad as POWER(0, 0). 😀

    :-DWhat do you want it to do?

    Do you want it to

    (a) return 0 so that f(x) = POWER (x,0) has a discontinuity at x = 0 while g(x) = POWER(0,x) is continuous everywhere (ie invert the current situation) or

    (b) return NaN so that both functions are "undefined" at x=0 (but that requires support for the IEEE standard in SQLS, which hasn't yet happened: see http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=239674) or

    (c) return a domain error (so that both functions are "undefined" in such a way that no programmer can deal with it and must always test for the special case) or

    (d) return two different catchable errors from POWER(0,X) (one for x < 0, another for x=0)

    ??

    For me, (b) is the only useful approach, but note that this requires in addition a catchable error to handle attempts to insert NaNs into an index column (since such columns can allow NaN no more than they can allow NULL).

    I seem to remember an argument made by one of my professors in college that "Zero to the Zeroth power" could be shown to be non-asymptotically discontinuous in an uncountably infinite number of ways and in fact in a transfinite-class number of ways that was at least one transfinite-class higher than that for "0/0". But that's probably too many exceptions to handle in most programs. 😀

    Point being (I guess), that even plain old numerical mathematics theory can never be perfectly mapped/applied to real programming, there's always something that has to be swept under the carpet and just smoothed over for practical purposes. It's the main reason that I get so prickly when Relational Purists start moaning about NULLs in SQL. Heck if even basic arithmetic has to swallow DivideByZero in application, then I think that the Relational Model should be able to survive NULLs. But that's jsut me ... 😀

    Now I am remembering, that it only makes sense to talk about (0**0) when it's a result returned from an equation, and only in the context of that equation's form. IIRC, my professor was talking about the function:

    Z = X^Y When X=0, and Y=0

    It's really nasty...;-)

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

Viewing 15 posts - 61 through 75 (of 81 total)

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