home / software / tips and tricks / SQL Server LEN() function and blank spaces

SQL Server LEN() function and blank spaces

Updated:  08/15/2014 14:08 PM
Author:  Shiju Mathews

Status:    Resolved.


Some time SQL server built in function LEN can be tricky.

LEN ( string_expression ) :
Returns the number of characters of the specified string expression, excluding trailing blanks. But the tricky part is that it will count blank spaces in before the given data in the string_expression, but exclude the blank spaces after the data in the string_expression.

Tags: SQL Server LEN() function and blank spaces
Updated on: April 2024