July 18, 2005 at 12:32 am
That's a good explanation, thank you
I would still prefer that '' and ' ' were different, but I guess there is not much to do about it
July 18, 2005 at 8:22 am
The most likely reason (in my opinion) trailing blanks are ignored in comparisons is that you have fixed-length character fields. If you're comparing a char(10) to a char(12) (or to a trimmed varchar) they would never be equal, unless you remembered to use RTRIM religiously. It's easier to have the RTRIM be automatic.
Not that it makes any real difference, but the wording I find in BOL is "trailing blanks are ignored", not that the shorter string is padded with blanks.
July 18, 2005 at 8:59 am
You might have a point when you say that "trailing blanks are ignored", rather than "the shorter string is padded with blanks". The first statement is simpler as it involves only the string itself. Furthermore, trailing blanks are also ignored when you calculate the length of a string: len('') = len(' ') = 0.
July 18, 2005 at 9:47 am
Hi Farrel,
Do you not do the word shortening thing where you are from?
Bully - Bulldozer?
Ah well, just get the avatar set and have done with it 😉
I do believe this thread has been answered......
Have fun
Steve
We need men who can dream of things that never were.
Viewing 4 posts - 46 through 48 (of 48 total)
You must be logged in to reply to this topic. Login to reply