Pages

Monday, April 27, 2009

REVERSE String in SQL Server

Today i would like to talk about very simple tip in SQL Server. If i ask you to write a logic to REVERSE a string then you probably will use While or For loop to do this.

Instead of writing complex logic, you can make use of REVERSE string function.

Its very simple to use. Just pass the string and it will reverses the string.

SELECT REVERSE('VIJAYA KADIYALA')

Output is:
--------------------
ALAYIDAK AYAJIV

If you want to perform the same task in Visual Basic (My favourite Language) then you need to wait for next day.

No comments: