Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » trailing spaces   (RSS)

Testing strings for equality counting trailing spaces

The SQL standard requires that string comparisons, effectively, pad the shorter string with space characters. This leads to the surprising result that N'' ≠ N' ' (the empty string equals a string of one or more space characters) and more generally any string equals another string if they differ only by trailing spaces. Here is a discussion of various work arounds.
 
Page view tracker