April 8, 2011 at 2:40 am
Only one comment: I want back my points! :-D:-D:-D
April 8, 2011 at 2:58 am
Carlo Romagnano (4/8/2011)
Only one comment: I want back my points! :-D:-D:-D
Ditto. Every other comment I was about to say has already been said.
April 8, 2011 at 3:06 am
Well, the question was wrong, I guess Sriram was a bit hasty :w00t:. I for one am happy to have my otherwise almost immaculate record destroyed by such. Unless of course everyone else has the points awarded back.
cheers,
Iain
April 8, 2011 at 4:09 am
Answer is 4 based on the question. As a lot of people have commented, the answer is based on a different data type
April 8, 2011 at 4:30 am
Clearly for nvarchar the answer should be 4. I have even taken the liberty of running the code just to make sure I'm not losing it.
Cheers.
Trevor.
April 8, 2011 at 4:56 am
CirquedeSQLeil (4/8/2011)
mohammed moinudheen (4/7/2011)
Books online reference below.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.
ms-help://MS.SQLCC.v10/MS.SQLSVR.v10.en/s10de_6tsql/html/81ee5637-ee31-4c4d-96d0-56c26a742354.htm
Answer should be 6.
The correct answer is 4 - run the code.
Yes Jason, the answer should be 4
M&M
April 8, 2011 at 4:59 am
JBregman (4/8/2011)
Steve, are you responsible for QoD selections? Shame on you!Jaap.
No personal attacks please.
M&M
April 8, 2011 at 5:01 am
A simple Q but a wrong A
I want my points
April 8, 2011 at 5:17 am
I agree.:-D:-D
Rick Karpel
April 8, 2011 at 5:48 am
I answered 4 but i had the wrong answer.
I tested it and the response is 4.
I don't understand why the question is not tested!!
April 8, 2011 at 5:58 am
Almost made me really thank God for an easy Friday question, only to find that the question and the answer are based on two completely different data types!
Thanks & Regards,
Nakul Vachhrajani.
http://nakulvachhrajani.com
Follow me on
Twitter: @sqltwins
April 8, 2011 at 6:08 am
:hehe::-D:crazy::blink::crying::-P
Far away is close at hand in the images of elsewhere.
Anon.
April 8, 2011 at 6:09 am
Was this a trick question designed to simulate the, ah, "impedance mismatch" between, say, developers and DBAs? (*sings* "You say NCHAR, I say NVARCHAR, let's call the whole thing off.")
I'll add my vote for a recall on this bogus question,
Rich
April 8, 2011 at 6:15 am
Question must be checked before posting ...
Answer is based on nchar while question is based on nvarchar..
April 8, 2011 at 6:16 am
I agree with the first reply. The first thing I looked for was if it was a fixed string or VARiable string.
I have been caught making the mistake of using the datalength to find the length of a string before.... those were some bad times.
Viewing 15 posts - 31 through 45 (of 138 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy