len / datalength - Russell Fields |
08-May-08 03:21:38
|
Jean-Nicolas,
From the BOL definition of LEN: Returns the number of characters, instead
of the number of bytes, of the given string expression, *** excluding
trailing blanks.***
Since 0x20 is a blank, the second selection for LEN(0x4020) only counts the
1 character 0x40.
RLF |
 |
| |
len / datalength - Tom Cooper |
08-May-08 03:24:18
|
Len() returns the number of characters, excluding any trailing blanks.
Since 0x20 is a blank, the value of Len(0x4020) is 1. But DataLength()
returns the number of bytes including any trailing blanks.
Tom |
 |
| |
len / datalength - SQL Menace |
09-May-08 07:50:51
|
Run this for fun
Select LEN(' ') As LengthVarChar,
LEN(N' ') As LengthNVarChar,
DATALENGTH(' ') As DataLengthVarChar,
DATALENGTH(N' ') As DataLengthNVarChar
Denis The SQL Menace
http://sqlservercode.blogspot.com
http://sqlblog.com/blogs/denis_gobo/default.aspx
On May 8, 3:00=A0pm, "Jean-Nicolas BERGER" <j-n.enlevezmoi.ber...@club- |
 |
| |