Cast in Varchar with different options

  • Thanks, It is good point

  • rhythmk (7/16/2012)


    It is upto you if you want to learn you can use in such cases where it is hard to count the characters (exactly 30 in b option) otherwise one can directly run the query in SSMS and check the output.

    But I always use honesty is best policy to learn and test.:-)

    I agree that running of a different query is honest. But I prefer questions where no tools other than brain and eyes are needed.

    For example the length of a literal as '1234567890123456789012345678901' can be counted quite quickly.



    See, understand, learn, try, use efficient
    © Dr.Plch

  • Nice question for a Monday. We've had ones like this recently enough that I would have expected the percent of correct answers to be closer to 100%. Maybe we have had a lot more new members join up recently?

  • honza.mf (7/16/2012)


    rhythmk (7/16/2012)


    It is upto you if you want to learn you can use in such cases where it is hard to count the characters (exactly 30 in b option) otherwise one can directly run the query in SSMS and check the output.

    But I always use honesty is best policy to learn and test.:-)

    I agree that running of a different query is honest. But I prefer questions where no tools other than brain and eyes are needed.

    For example the length of a literal as '1234567890123456789012345678901' can be counted quite quickly.

    Could you imagine the uproar it would cause here if someone asked this question with that string and left the 2nd '7' out of there, or something to that effect?

  • good question - cheers

  • An easy one to start my week.

    I learned something: I laboriously counted characters on the page instead of simply copying them to Notepad. 😉

  • thanks for the question.

    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

  • roryp 96873 (7/16/2012)


    honza.mf (7/16/2012)


    rhythmk (7/16/2012)


    It is upto you if you want to learn you can use in such cases where it is hard to count the characters (exactly 30 in b option) otherwise one can directly run the query in SSMS and check the output.

    But I always use honesty is best policy to learn and test.:-)

    I agree that running of a different query is honest. But I prefer questions where no tools other than brain and eyes are needed.

    For example the length of a literal as '1234567890123456789012345678901' can be counted quite quickly.

    Could you imagine the uproar it would cause here if someone asked this question with that string and left the 2nd '7' out of there, or something to that effect?

    Yes, of course :hehe:



    See, understand, learn, try, use efficient
    © Dr.Plch

  • Thanks for the question. Basic thing but I did not paid attention to detail, so -1

    Regards,

    Iulian

  • AAAAAAAHHHHHHHHH!!!!

    I knew the right answer, I thought I selected the right answer, it turns out I clicked the wrong answer!!!

    AAAAAAAAHHHHHHHHHH!!!

    Ah well... one point lost that I shouldn't have except I was being too lazy.



    --Mark Tassin
    MCITP - SQL Server DBA
    Proud member of the Anti-RBAR alliance.
    For help with Performance click this link[/url]
    For tips on how to post your problems[/url]

  • Thank you for the easy, back-to-basics question.

    "El" Jerry.

    "A watt of Ottawa" - Gerardo Galvan

    To better understand your help request, please follow these best practices.[/url]

  • mtassin (7/16/2012)


    AAAAAAAHHHHHHHHH!!!!

    I knew the right answer, I thought I selected the right answer, it turns out I clicked the wrong answer!!!

    AAAAAAAAHHHHHHHHHH!!!

    Ah well... one point lost that I shouldn't have except I was being too lazy.

    Have a cup of coffee before you click. Works for me!

  • Easy one...

    Thanks

  • Thanks for the easy question. I realized only after submitting the question I have to count characters. So -1.

  • Good one,thank you.

    “When I hear somebody sigh, ‘Life is hard,’ I am always tempted to ask, ‘Compared to what?’” - Sydney Harris

Viewing 15 posts - 16 through 30 (of 44 total)

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