String Functions – RTRIM()

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

The RTRIM() function takes a source string as input and returns a output string with all trailing spaces removed.

The following example removes trailing spaces from a favorite movie title of mine.

One thing to always worry about when using TSQL functions is how will it react with empty strings or NULL values? Both empty strings and NULL values as input return themselves as output.

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

Related posts

Leave a Comment