Starting from SQL Server 2008, the REVERSE()
function can be used to reverse the order of a string. That is, it returns the characters in the string in reverse order.
Here’s the syntax:
REVERSE ( string_expression )
Where string_expression
is an expression of a string or binary data type. It can be a constant, variable, or column of either character or binary data.