• Honestly I would guess that LEN works the way it does because the vast majority of the time you don't want to have to worry about the trailing spaces. I know when I use it I usually don't want to see the extra spaces. Probably on the order of 90% of the time. Now that doesn't mean I don't get bitten every now and again on the other 10% but I would rather that than get bitten on the 90%.

    As an example if I have a field ZIPCODE varchar(10) and a row with '12345 ' and another table with '98765' and I'm trying to find any zipcode with more than 5 characters I really don't want to have to worry about the trailing spaces. I could use LTRIM, but I would be adding LTRIM far more frequently than I would be dealing with figuring out if I have an extra space at the end or not.

    Kenneth

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]