• Manie Verster (9/11/2009)


    When I pasted the result in here directly from ssms I saw that there was actually a space at the end but what stumps me is the fact that it gave a LEN of 5 characters and that does not include the space at the end. Can someone please clear this for me 'cause I am stumped.

    http://msdn.microsoft.com/en-us/library/ms190329.aspx

    It's just the way MS decided to display length. It could be part of an ISO standard on how to report string lengths. If you wanted true length, do LEN(@str+'-')-1.

    /* Anything is possible but is it worth it? */