SQL Query to Remove Trailing Spaces Last Updated : 29 Sep, 2021 Comments Improve Suggest changes Like Article Like Report In this article, we will look at how to remove trailing spaces. Trailing spaces means the space characters from the right side. We need to use the RTRIM() function. The RTRIM function is used for removing all specified characters from the right-hand side of a string. T Syntax: RTRIM(string)Parameter: string - This is the only required parameter which is a string to remove the trailing spaces.Applies to: This function applies to the following databases. SQL Server (all supporting versions),Parallel Data WarehouseAzure SQL Data WarehouseAzure SQL Database,Example 1: Query: SELECT RTRIM('Geeks for Geeks ');Output: +------------------+ | (No column name) | +------------------+ | Geeks for Geeks | +------------------+Example 2: Query: SELECT RTRIM(' GeeksforGeeks ');Output: +------------------+ | (No column name) | +------------------+ | GeeksforGeeks | +------------------+ Comment More infoAdvertise with us Next Article SQL Query to Remove Trailing Spaces S snehalchitnis1851 Follow Improve Article Tags : SQL SQL-Server SQL-Query Similar Reads SQL Query to Remove Decimal Values In SQL, decimal values are often used to represent floating-point numbers. However, there are instances where we might need to remove decimal places or adjust the number of decimals in your queries. In this article explains various methods in SQL to remove or round off decimal values, including ROUN 3 min read Remove All Spaces From a String in SQL Server There are scenarios of the occurrence of spaces before and after a string and we may need to remove/trim the spaces for our use. Let us see how it is getting handled in SQL Server. Till SQL Server 2016, we have the functions called SQL LTRIM and SQL RTRIM functions. The name itself implies that LTRI 3 min read Replace String in SQL Server In SQL Server, manipulating data from a table and applying functions to modify values dynamically is a common task. One such example involves replacing parts of strings, such as email domains. This content demonstrates how string replacement can be applied to a dataset that includes employee informa 2 min read How to Remove Spaces in Excel Have you ever wondered you keep searching data on Excel but it is not returning any values and many times you are trying to add columns or data but you are unable to do so? Well, these are some common problems we all have faced in our life. But do you know why it happens? This happens because of ext 8 min read How to Remove Spaces From a String using JavaScript? These are the following ways to remove space from the given string:1. Using string.split() and array.join() MethodsJavaScript string.split() method is used to split a string into multiple sub-strings and return them in the form of an array. The join() method is used to join an array of strings using 2 min read Like