Export (0) Print
Expand All
ABS
ALL
AND
ANY
AVG
bit
COS
COT
DAY
EXP
GO
IN
LEN
LOG
MAX
MIN
NOT
OR
PI
SET
SIN
STR
SUM
TAN
USE
VAR
Expand Minimize
2 out of 4 rated this helpful - Rate this topic

REVERSE

SQL Server 2000

Returns the reverse of a character expression.

Syntax

REVERSE ( character_expression )

Arguments

character_expression

Is an expression of character data. character_expression can be a constant, variable, or column of either character or binary data.

Return Types

varchar

Remarks

character_expression must be of a data type that is implicitly convertible to varchar. Otherwise, use CAST to explicitly convert character_expression.

Examples

This example returns all author first names with the characters reversed.

USE pubs
GO
SELECT REVERSE(au_fname) 
FROM authors
ORDER BY au_fname
GO

Here is the result set:

-------------------- 
maharbA              
okikA                
treblA               
nnA                  
ennA                 
truB                 
enelrahC             
lyrehC               
naeD                 
kriD                 
rehtaeH              
sennI                
nosnhoJ              
aiviL                
eirojraM             
rednaeM              
leahciM              
lehciM               
ratsgninroM          
dlanigeR             
lyrehS               
snraetS              
aivlyS               
(23 row(s) affected)

See Also

CAST and CONVERT

Data Types

String Functions

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.