String Functions – LEN()


I am going to continue my series of very short articles or tidbits on Transaction SQL string functions. I will exploring the LEN() function today.

The LEN() function takes one string argument as input and returns one integer argument, the size of the input string, as output

The following example determines the title length of a favorite movie of mine.

One thing to always worry about when using TSQL functions is how will it react with a UNKNOWN or NULL values?

Last but not least, the empty string may return interesting results. In our case, the length of a empty string is zero.

Next time, I will be exploring the LOWER() function.

Related posts

Leave a Comment