REVERSE() Function in SQL Server Last Updated : 13 Sep, 2024 Comments Improve Suggest changes Like Article Like Report The REVERSE() function in SQL Server is a simple and powerful tool designed to reverse the order of characters in a string. By taking a string input, it returns a new string with its characters arranged in the opposite sequence. In this article, We will learn to REVERSE() Functions in SQL Server by understanding various examples in detail.SQL Server REVERSE() FunctionThe REVERSE() function in SQL Server is used to reverse the characters in a string. This function takes a string as input and returns a new string where the characters are arranged in reverse order.Features of REVERSE() Function in SQL ServerThis function is used to reverse the order of characters in the specified string.This function accepts strings as parameters.This function always returns a string. This function can also reverse a string representation of integers.This function can even reverse float values.Syntax:REVERSE(string)Parameter : This method accepts only one parameter as given below : string : Specified string to be reversed. Returns: It returns the stated string in the reversed form. Example 1: Reversing a StringReverse the characters of the string 'gfG'.SELECT REVERSE('gfG');Output:GfgExplanation: The REVERSE() function converts 'gfG' to 'Gfg', reversing the order of characters.Example 2: Reversing a String from a VariableReverse the characters of a string stored in a variable.DECLARE @string VARCHAR(15); SET @string = 'geeksforGeeks'; SELECT REVERSE(@string);Output:skeeGrofskeegExplanation: The function reverses the string 'geeksforGeeks', resulting in 'skeeGrofskeeg'.Example 3: Reversing a Set of IntegersReverse the digits of the integer 123.SELECT REVERSE(123);Output:321Explanation: The function treats the integer 123 as a string and reverses it to produce '321'.Example 4: Reversing a Float ValueReverse the characters of the float value 1.56.SELECT REVERSE(1.56);Output:65.1Explanation: The function converts the float 1.56 to the string '1.56' and then reverses it to '65.1'.ConclusionThe REVERSE() function in SQL Server is a versatile tool for string manipulation. It can handle not only text strings but also numeric values, converting them into strings and reversing their order. This function is particularly useful in scenarios requiring string reformatting or data processing. Comment More infoAdvertise with us Next Article REVERSE() Function in SQL Server nidhi1352singh Follow Improve Article Tags : SQL Databases DBMS-SQL SQL-Server Similar Reads LOWER() function in SQL Server LOWER() : This function in SQL Server helps to convert all the letters of the given string to lowercase. If the given string contains characters other than alphabets, then they will remain unchanged by this function. Syntax : LOWER( str ) Parameters : str - The string which will be converted to lowe 2 min read RTRIM() Function in SQL Server The RTRIM() function removes trailing spaces from a string. Syntax : RTRIM(input_string) Parameter : RTRIM() function accepts single-parameter like input_string. input_string : It is an expression of character or binary data. It can be a literal string, variable, or column. Returns - It returns a st 1 min read REPLICATE() Function in SQL Server REPLICATE() function : This function in SQL Server is used to repeat the specified string for a given number of times. Features : This function is used to return the stated string for a given number of times. This function accepts only strings and integers as parameter. This function returns an erro 2 min read LTRIM() Function in SQL Server The LTRIM() function in SQL Server removes all the space characters found on the left-hand side of the string. It removes the leading spaces from a string, SyntaxThe LTRIM function for SQL Server syntax is: LTRIM(string, [trim_string]) Parameter: string - The string from which the leading space char 2 min read NCHAR() Function in SQL Server NCHAR() function : This function in SQL Server is used to return the Unicode character that is based on the number code. For example, if the specified number is 65 then this function will return A. Features : This function is used to find the Unicode character of a given number. This function accept 2 min read LOG() Function in SQL Server The LOG() function returns the logarithm of a specified number or the logarithm of the number to the specified base. Syntax : LOG(number, base) Parameter : LOG() function accepts two-parameters as mentioned above and described below. number - This parameter hold a number which is greater than 0. bas 1 min read MIN() Function in SQL Server MIN() : This function in SQL Server is used to find the value that is minimum in the group of values stated. Features : This function is used to find the minimum value.This function comes under Numeric Functions.This function accepts only one parameter namely expression. Syntax : MIN(expression) Par 2 min read QUOTENAME() Function in SQL Server QUOTENAME() function : This function in SQL Server is used to return a Unicode string with delimiters added in order to make the string a valid SQL Server delimited identifier. Features : This function is used to find a Unicode string with delimiters added. This function accepts only strings and del 3 min read ISNUMERIC() Function in SQL Server The ISNUMERIC() function in SQL Server is a critical tool for determining whether a given expression or value can be interpreted as a numeric type. This function is valuable for data validation and ensuring that values conform to numeric formats before performing calculations or other operations tha 3 min read SQL Server POWER() Function The POWER() function in SQL Server is a mathematical function that computes the result of raising a number (the base) to the power of another number (the exponent). It is a versatile function used for various calculations, such as squaring a number, computing roots or applying exponential growth in 3 min read Like