Length Function

The Length() function returns the length of input as number of characters. It works better with ASCII characters and may not return correct number of characters for unicode data, use LEN function for unicode.

The syntax is simple Length( string ).

SELECT Length('10.25') /* returns 5 */ ;

SELECT Length('SQLDatabase.Net') /* returns 15 */ ;

SELECT Length('數據庫') /* returns 2 */

LENGTH function is useful to get the length of data, it counts special characters e.g. each spaces and blanks are counted.