ScottPletcher wrote:LEN() has always not counted trailing spaces.
Yes, I know this and it's implied in the OP due to me explicitly comparing LEN
to DATALENGTH
and no even entertaining the former as a "solution". This is why for a varchar
I would use DATALENGTH
and for an nvarchar
use DATALENGTH() / 2
. As mentioned, that doesn't work for an UTF8.
Adding a character at the end, and then "minusing" 1 from the LEN
, however, hadn't even crossed my mind!
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk