LEN Function

The len() function returns the length in bytes using UTF-8, there is also a length function which returns length in character. If you are using non-ASCII characters then use LEN functions.

The syntax is simple LEN( string ).

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

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

SELECT LEN('數據庫') /* returns 9 */

Len function is useful to get the length of data, can use be used to initialize byte array.