Cast in Varchar with different options

  • Comments posted to this topic are about the item Cast in Varchar with different options

  • Thanks for an easy, back to basics 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]

  • Nice one.

    But it's very hard to count the chars early in the morning. Luckily the string in b is not 31 or 32 characters long.



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

  • honza.mf (7/16/2012)


    Nice one.

    But it's very hard to count the chars early in the morning. Luckily the string in b is not 31 or 32 characters long.

    +1

    I copied the strings to notepad to see the length :-D.

  • Nice question 🙂

    [font="Courier New"] Thank u Paresh for giving the basic one[/font]

    [font="Verdana"] There is no Wrong time to do a Right thing 🙂 [/font]

  • Nice "easy basics" question to start the week - thanks!

    Counting that many similar characters is not that easy though!!!

  • I was expecting to see a 100% correct rate given that the same thing has appear a lot in QOTDs over the last few months - but currently just 60% so obviously bears repeating.

    The moral as always is never to rely on default precision but always specify 🙂

  • This was removed by the editor as SPAM

  • Easy question but very important basic question.

    Thank. keep growing

    Thanks
    Vinay Kumar
    -----------------------------------------------------------------
    Keep Learning - Keep Growing !!!

  • Stewart "Arturius" Campbell (7/16/2012)


    Good back-to-basics question, thanks

    Wot he said 😛

    _____________________________________________________________________
    [font="Comic Sans MS"]"The difficult tasks we do immediately, the impossible takes a little longer"[/font]

  • A good question, in that if you knew the behaviour being asked about, then it was easy to pick the correct answer as there was no unnecessary obfuscation.

  • Thanks for the question, which was perfect for a Monday. I must admit I hesitated before clicking the correct answer. A few recent questions have made me see conspiracies everywhere. 🙂

    [font="Verdana"]Please don't go. The drones need you. They look up to you.[/font]
    Connect to me on LinkedIn

  • kupy (7/16/2012)


    honza.mf (7/16/2012)


    Nice one.

    But it's very hard to count the chars early in the morning. Luckily the string in b is not 31 or 32 characters long.

    +1

    I copied the strings to notepad to see the length :-D.

    Could have use LEN function. 😉

    SELECT LEN('aaaaaaaaaaaaaaaaaaaaabbbbbbbbb')

    --rhythmk
    ------------------------------------------------------------------
    To post your question use below link

    https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help
    🙂

  • rhythmk (7/16/2012)


    kupy (7/16/2012)


    honza.mf (7/16/2012)


    Nice one.

    But it's very hard to count the chars early in the morning. Luckily the string in b is not 31 or 32 characters long.

    +1

    I copied the strings to notepad to see the length :-D.

    Could have use LEN function. 😉

    SELECT LEN('aaaaaaaaaaaaaaaaaaaaabbbbbbbbb')

    Notepad is OK, but I feel unfair to run a query or a part of it 🙂



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

  • honza.mf (7/16/2012)


    rhythmk (7/16/2012)


    kupy (7/16/2012)


    honza.mf (7/16/2012)


    Nice one.

    But it's very hard to count the chars early in the morning. Luckily the string in b is not 31 or 32 characters long.

    +1

    I copied the strings to notepad to see the length :-D.

    Could have use LEN function. 😉

    SELECT LEN('aaaaaaaaaaaaaaaaaaaaabbbbbbbbb')

    Notepad is OK, but I feel unfair to run a query or a part of it 🙂

    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.:-)

    --rhythmk
    ------------------------------------------------------------------
    To post your question use below link

    https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help
    🙂

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

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