• Adam Haines (6/25/2010)


    While this is true.... a string is a string, but the deviation here is the method used to evaluate the strings. Part of the ANSI standard is to make strings evaluated with "=" the same length before comparison and this is not a requirement for pattern matching. Like uses pattern matches so the string does not have to be equal.

    Maybe it is the ANSI standard to do so, in which case I expand my dislike from SQL Server to ANSI. I seriously cannot understand how an implicit truncation of spaces is helpful. Like I said, a string is a string, whether the characters are ascii 32 or not. It doesn't take much to truncate the trailing spaces yourself if you need to do it.

    Most (if not all) programming languages I've developed in so far in my 30-odd years have followed this procedure, and it works well. Not only well, but it's just intuitively correct, unlike this.