Variant order 1

  • Comments posted to this topic are about the item Variant order 1

    Tom

  • Rather simple question .....

    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]

  • even though x=y, and y=x, your case statement catered for the following result:

    'v3 = v2' and no where specifies v2=v3.

    "None of the Above" should be correct as well.

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    This thing is addressing problems that dont exist. Its solution-ism at its worst. We are dumbing down machines that are inherently superior. - Gilfoyle

  • I agreed!

    From the programming logic, "v2 = v3" could not be displayed! In fact, the right answer should be "None of the above". If the editor admit that it is a typo mistake, then both "v2 = v3" and "None of the above" should be correct in order to be fair.

  • Tom

    Thanks for a REALLY interesting QotD. I wish I came up with this one.

  • Nice question Tom.

  • Must say I agree with Henrico Bekker, the case statements at no point say v2 = v3, but rather v3 = v2. Whilst the mean the same thing, I agree that None of the Above should also be an applicable answer for those who are being pedantic.

  • Got it wrong because I believe it should say "v3 = v2" not "v2 = v3"


    Forever trying to learn
    My blog - http://www.cadavre.co.uk/
    For better, quicker answers on T-SQL questions, click on the following...http://www.sqlservercentral.com/articles/Best+Practices/61537/
    For better, quicker answers on SQL Server performance related questions, click on the following...http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • Answer is v1 > v2v1 > v3v3 = v2v4 > v1

    and not "v1 > v2v1 > v3v2 = v3v4 > v1"

  • good question and explanation!!!!

    thanks Tom!!!


    [font="Times New Roman"]rfr.ferrari[/font]
    DBA - SQL Server 2008
    MCITP | MCTS

    remember is live or suffer twice!
    the period you fastest growing is the most difficult period of your life!
  • Good question. Thanks, Tom! 😉

    To me, it was immediately obvious that the v3=v2 / v2=v3 error was a mistake made when entering the question and not a deliberate trick.


    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/

  • While not exactly a comment on the outcome of this question, I do wonder whether people out there actually use variants. I never have, and also don't see the case for them.

    The QotD seems increasingly to have very "clever" questions about T-SQL behaviour that are most esoteric and have little bearing on my day to day use of the language.

    Or maybe I'm just weird :hehe:

  • Hugo Kornelis (11/30/2011)


    To me, it was immediately obvious that the v3=v2 / v2=v3 error was a mistake made when entering the question and not a deliberate trick.

    Same here, but that was largely because I've followed Tom's comments on these forums for a while and didn't think he'd resort to trick questions 🙂

  • Toreador (11/30/2011)


    Hugo Kornelis (11/30/2011)


    To me, it was immediately obvious that the v3=v2 / v2=v3 error was a mistake made when entering the question and not a deliberate trick.

    Same here, but that was largely because I've followed Tom's comments on these forums for a while and didn't think he'd resort to trick questions 🙂

    True that. Would the question have come from someone I didn't know yet, I would have picked the same answer, but with less confidence in the outcome. It is a sad fact that some of the questions submitted to the QotD are indeed trick questions.


    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/

  • Good question thanks Tom. Made learn more about sql_variant comparisons.

    Got the answer wrong though as thought it was a trick question too.

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

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