July 24, 2003 10:24 PM

Counting Blank Spaces

Rating: (0)
SQL Server Magazine
InstantDoc ID #39445

Why does the command SELECT LEN('123' + ' '), which counts the number of characters in a field, return three when it should return eight? Three characters plus five blank spaces is eight characters in total. How can I count the blank spaces?

When in doubt about unexpected behavior, read SQL Server Books Online (BOL). The BOL entry for the LEN() function says that it ignores trailing blanks. Many people make the mistake of assuming the LEN() function will count t...

...This article is for paid Professional Members only.

Already a Professional Member? Please log in now:

NOT A PROFESSIONAL MEMBER? YOU CHOOSE:

Professional Membership

Monthly

Annual

VIP Membership

Monthly

Annual

Add a Comment

There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here
GOOGLE LINKS
SPONSORED LINKS
FEATURED LINKS