Microsoft SQL Server String Functions RTrim

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

Returns a character expression (varchar or nvarchar) after removing all trailing white spaces, i.e., spaces from the right end of the string up until the first non-white space character to the left.

Parameters:

  1. character expression. Any expression of character or binary data that can be implicitly converted to varcher, except text, ntext and image.
SELECT RTRIM('This is my string     ') -- Returns 'This is my string'


Got any Microsoft SQL Server Question?