|
Comments
|
|
I think it would have been wise to show that if you use DATALENGTH with an nvarchar, you need to divide by 2 to convert the number of bytes to characters.
|
|
Ed Svastits on
10/25/2010
Good explanation between LEN() and DATALEN(). A useful function to get rid of leading spaces is LTRIM() if you just want to determine the length of non-space characters in a string.
|
|
Kenneth Wymore on
10/25/2010
Good info. I never used datalength because of the way it handles char. Thank you for showing how to use it and when.
|
|
|
Nice spin through datalength.
|
|
|
You could make the output easier to see
|
|
Dexter Jones on
10/25/2010
Clear and concise, as usual.
Thanks, Andy!
|
|
|
very nice
|
|
|
Very good video in explaining the difference between len and datalength.
|
|
|
_Please_ increase the font size of the results. Those 0, 2, and 3 numbers were almost unreadable. Thanks.
|
|
|
Very helpful. I like the ugly hack. :-)
|
|
Carla Wilson on
10/25/2010
Demonstrating datalength with nvarchar would have been another good "twist" to point out.
|
|
|
Good reminder about trimming trailing spaces.
|
|
|
sweet.
|
|
|
good
|
|
|
It would be great if there was a link on the videos to download/open the code shown
|
|
|
Good lesson
|
|
|
You've graciously upped the font size on the query window. Thank you. Would you do likewise on the Results/Output window, please?
|
|
James Lawrence on
10/26/2010
some good tips here...
|
|
|
So much I have to learn.
|
|
|
Good explanation from Andy as usual
|
|
valluru raghu on
10/26/2010
good
|
|
Kory Skistad on
10/27/2010
It may be worth mentioning that the behavior for trailing spaces that Andy demonstrated is controlled by the ANSI_PADDING setting. The default setting is ON which preserves trailing spaces. Setting this to OFF will ignore trailing spaces. However, Microsoft recommends you leave the default setting. In fact, it claims that in future versions of SQL Server, the only option will be ON and setting to OFF will produce an error.
|
|
Don Weigend on
10/27/2010
I did not know that the length function does a right trim, that is useful to know. Thanks for the great tip!
|
|
|
good video
|
|
|
very good
|
|
|
Excellent demo of the differences between the two.
|
|
|
Helpful. Thanks
|
|
|
Wow, I never knew that LEN didn't take into account trailing spaces. Good info!
|
|
|
How does row compression affect datalength.
|