Comments posted to this topic are about the item Field Lengths
Hall of Fame
Easy one. Thanks.
easy one, very easy point.....
And, these kind of QOTD are already been posted...... 🙂
Easy one. Thanks.
Easy one for Friday. Thanks
Hope this helps...
Rock and Roll Detective
Nice question. I always mix up DATALENGTH and LEN.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
DATALENGTH provides exact length of the field if it is fixed length. If the field is of variable length, it returns the length of the data in the field
It's not quite true. A variable of type CHAR is padded with blanks, so DATALENGTH returns the numbers of BYTES occupied by data with trailing SPACES.
If you use NCHAR(10), e.g., DATALENGTH returns 20, because data take 20 bytes of storage.
Simple question, but wonder why the question was not just focused on column d and e and DATALENGTH and LEN.
This was removed by the editor as SPAM
You cannot get to the top by sitting on your bottom.
Nice question Steve. 🙂
TGIF... Cheers... :satisfied:
Right there with Babe
I wonder what was the thinking behind the third answer?
Why would someone think '10' will be returned if you entered '40' at the insert?
Maybe I was just clever to read from the back 😛
You are correct in your statement. However, just wanted to give an easy overview explanation to the answer. I could have gone "real deep" in the explanation, but I thought not too.
Again, thanks for the follow up 😉
Thank you for your responses. I thought an easy one for Friday would be fun and since a lot of "DBA's" (logical\physical\both) have issues with data\field storage, this would be a nice example. I just joined SQLServerCentral and I must say I have really enjoyed taking the quizzes, reading the articles, collaborating with my peers, etc. 😀
Again, happy Friday to all and expect more from me.
Viewing 15 posts - 1 through 15 (of 21 total)