Length

  • jeff.mason (4/8/2011)


    Guys, I think we all know that the question as originally posted is FUBAR. We know Steve will fix it and points returned. Let's all calm down and wait for Steve to log in.

    But it's so much fun discussing and ranting about it. 😉

  • Locate hornets' nest, insert stick.

    I will have to assume that either this is a simple typo or an ingenious method to rile the community.

    Since we are all SQL people here -- How many of you caught the inconsistency between the query and the question before you submitted your answer? Or, as an analogy, how many of you pressed Execute before checking your code?

  • CirquedeSQLeil (4/8/2011)


    mohammed moinudheen (4/7/2011)


    Books online reference below.

    nvarchar [ ( n | max ) ]

    Answer should be 6.

    The correct answer is 4 - run the code.

    Datalength doesn't take into account the variable character overhead of 2 bytes. The correct answer is indeed 4. I was happy for an easy Friday question... and instead I got this... :/



    --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]

  • Hey, April Fools was LAST Friday!

  • Cliff Jones (4/8/2011)


    Hey, April Fools was LAST Friday!

    This gets my vote for best post in this thread.

    - webrunner

    -------------------
    A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
    Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html

  • Human error happens all the time.

    I personally love this QotD part of SQLServerCentral it gives me something to think about every morning.

    Alex S
  • Hmmmm....everyone seems to have covered ALL the bases already, so I'll just wait for a ruling from the judges as to what to do about the point(s) lost. I also enjoy this part of SQL Server Central. I read this daily post every morning and have a growing SQLHints document with code snippets contained therein for emergencies. Thanks everyone for past articles, editorials and responses in all the forums that I have referenced in the past to help me solve daily issues.

  • It's not 4?

  • Cliff Jones (4/8/2011)


    Hey, April Fools was LAST Friday!

    Clearly the error in today's question comes from a glitch in last week's conversion of the site to use BigTable.

  • pkeeler (4/8/2011)


    Cliff Jones (4/8/2011)


    Hey, April Fools was LAST Friday!

    Clearly the error in today's question comes from a glitch in last week's conversion of the site to use BigTable.

    And I vote THIS post as best in the thread. I feel for the poor guy who made the typo in the question originally though :). If you look the answer explanation even says NCHAR.

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]

  • Yeesh! Easy enough to test the code.

  • Fitting end to the week: I know I got the right answer but never fail, there is somebody telling me I got it wrong.

    _____________________________________________________________________
    - Nate

    @nate_hughes
  • Same, the good answer for me is 4. the Explication and code isn't correct

  • So, somebody asks us a question, we give them the right answer, then we find out we're wrong because they really meant to ask us a different question.

    Sounds like what we go through with our clients every day....:crazy:

    Rob Schripsema
    Propack, Inc.

  • Rob Schripsema (4/8/2011)


    So, somebody asks us a question, we give them the right answer, then we find out we're wrong because they really meant to ask us a different question.

    Sounds like what we go through with our clients every day....:crazy:

    How I wish that I would never experience that...

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

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