The answer to life, the universe and prime numbers

  • Of course every sci fi person would know this, but it was fun seeing how you got to the answer. We now know the question.

  • Thank you all for the interesting discussion, don't panic and remember the Towel day[/url]

    😎

  • Shadab Shah (2/26/2015)


    So Experts, which is the correct explanation. Either given by Eirikur Eiriksson or Toreador.

    The one given by Toreador. The implicit conversion from -51 to varchar(1) discovers that '-51'is 3 characters, which is more than 1, so it delivers '*' to indicate that the the conversion was not possible.

    Tom

  • Excellent post , Toreador. You are right. The * means only that the value -51 cannot represent any ASCII character for which the minimum value is 0 ( maybe , in English , it means that or , if my remembrance is not too bad , SQL Server represents always invalid values by * ).

    As soon as we know that , the "good answer" is evident. And if we know the numerical value for * ( 42 ) , that's 2 points easy to grab.

    I hope that I have not written in an English too difficulty understandable.

  • Nice question, thanks.

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

  • patricklambin (2/26/2015)


    Excellent post , Toreador. You are right. The * means only that the value -51 cannot represent any ASCII character for which the minimum value is 0.

    Actually that's not what I said, and it's not true. The * means that "-51" is too long to fit into a varchar(1) field.

    If you try ASCII("-51") you will get 45, which is the ascii value for "-" - the rest of the string is ignored.

  • Hahahaha yes 42 is the answer to everything

Viewing 7 posts - 31 through 36 (of 36 total)

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