Length

  • Is the 'point' column an integer or a decimal field? (I think we should all get an extra .5 point for the aggrevation :-P)

  • Stephen_W_Dodd (4/8/2011)


    Is the 'point' column an integer or a decimal field? (I think we should all get an extra .5 point for the aggrevation :-P)

    As far as I know it is an integer, which is part of why you get no credit for only choosing some of the correct answers for a multiple selection question.

    But why stop at half an extra point, I'll take a whole extra point. 😀

  • one more vote for "the answer is for a different question"

  • Yet another unforgivable mistake by a question setter.

    Let's hang, draw & quarter the lot of 'em.

    Kenneth Spencer

    PS: point back please.

    You never know: reading my book: "All about your computer" might just tell you something you never knew!
    lulu.com/kaspencer

  • kaspencer (4/8/2011)


    Yet another unforgivable mistake by a question setter.

    Let's hang, draw & quarter the lot of 'em.

    Kenneth Spencer

    PS: point back please.

    Now, now ... as one who will have his 39th QOD posted in the coming week I resent your comment, even if in jest.

    Let me issue you a challenge: You submit a QOD and lets see how well you do. Remember the objective of the QOD. To allow one to test their knowledge and / or as a teaching tool to expand one's knowledge. The gauntlet is thrown either, submit and have published a QOD which you authored or do not make disparaging remarks about those who do.

    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]

  • Oh yes.. totally unforgivable .. the correct answer is 4, because there's NVARCHAR(30) in declaration.

    But.. MS says 2 + 2 times the length of the string.. which is not correct in terms of the return value of the function datalength().

    Another interesting thing is, that SQL Server interprets a written value 'anystring' as a VARCHAR. (I guess it can be adjusted in some internal settings).

    Prove is there>

    DECLARE @b-2 SQL_VARIANT

    SET @b-2='bb'

    SELECT DATALENGTH(@b)

    SELECT SQL_VARIANT_PROPERTY ( @b-2, 'basetype')

  • Daniel Pokrývka

    But.. MS says 2 + 2 times the length of the string.. which is not correct in terms of the return value of the function datalength().

    2 + 2 times the length of the sring is the storage space required, NOT the length of the data. So the DATALENGTH function is correct.

    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]

  • Same Bad Feeeeeeelllll 🙁 as others.. My answer is correct for nvarchar.....

    Thanks & Regards, Kartik M Kumar..

  • CirquedeSQLeil (4/7/2011)


    Good to see that I am not the only one to claim that the proposed answer is COMPLETELY wrong.

    It was kind of shocking to see that it was wrong when I selected 4 and thought what did I do wrong. Alas, it was just the question that was wrong:-D

    Looks like only 70% of us got the correct wrong answer (4). I find it pretty apalling that 30% got it wrong (although some of those were told they got it right) with a question this easy. Not too worried about the error in the question/answer - Steve will fix it as usual, and some mistakes will always slip through unless an inordinate amount of effort is put into checking by editors (in theory we should be able to get questions right without checking by an editor; in practise one's own mistakes are usually the hardest to spot).

    Tom

  • oh! how does the answer doesn't match...grrrrrrrrrrrrrrrrrrr! my point lost.

  • Thanks for the clarification ! ..

    Please, can you explain to me what is the difference between data length and data storage consumption ? I know I could probably google it up and educate myself a bit but I believe you can provide this particular answer with less effort than I would have to make to clear it up for me 🙂

    Thank you..

  • ptn1 (4/8/2011)


    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?

    Excellent point! That's what I learned!!

    Peter Trast
    Microsoft Certified ...(insert many literal strings here)
    Microsoft Design Architect with Alexander Open Systems

  • Tom.Thomson (4/9/2011)


    CirquedeSQLeil (4/7/2011)


    Good to see that I am not the only one to claim that the proposed answer is COMPLETELY wrong.

    It was kind of shocking to see that it was wrong when I selected 4 and thought what did I do wrong. Alas, it was just the question that was wrong:-D

    Looks like only 70% of us got the correct wrong answer (4). I find it pretty apalling that 30% got it wrong (although some of those were told they got it right) with a question this easy. Not too worried about the error in the question/answer - Steve will fix it as usual, and some mistakes will always slip through unless an inordinate amount of effort is put into checking by editors (in theory we should be able to get questions right without checking by an editor; in practise one's own mistakes are usually the hardest to spot).

    Well, if I ran it before I answered I would have got the right "right" answer, too 🙂

    But I tried to use my existing knowledge which was short on this topic, instead of "testing" it. What is the point of running the code before answering the question? I could also wait until the next day to read the answer in the newsletter before answering. What would be the difference?

    Why are you surprised that so many missed it? When I was teaching SQL Server classes, I had whole FEATURE sets that were unknown to DBA's with 10+ years of experience... lol... sometimes, you just don't know about something, and that's why I keep coming back.

    Is anyone still reading this post down to page 11? 😀

    Peter Trast
    Microsoft Certified ...(insert many literal strings here)
    Microsoft Design Architect with Alexander Open Systems

  • Peter Trast (4/10/2011)


    Is anyone still reading this post down to page 11? 😀

    No.

    😉

    Rich

  • nvarchar [ ( n | max ) ]

    Variable-length Unicode character data. n can be a value from 1 through 4,000. max indicates that the maximum storage size is 2^31-1 bytes. The storage size, in bytes,

    is two times the number of characters entered + 2 bytes.

    The data entered can be 0 characters in length. The ISO synonyms for nvarchar are national char varying and national character varying.

    The answer is 6. How do these people actually consider themselves professional when they cant even answer questions they write?

Viewing 15 posts - 91 through 105 (of 138 total)

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