REVERSE Function in SQL Server   Leave a comment

Reverse Function: Reverse function is used to reverse the text provided to the command.

Using reverse function you can not only reverse the content but also along with the CharIndex function you can extract the substring as you are extracting by finding the last index in other programming language.


Select REVERSE(‘E:\ABC\PQR\Test.txt’) Rev, REVERSE(SUBSTRING(REVERSE(‘E:\ABC\PQR\Test.txt’),0,CHARINDEX(‘\’,REVERSE(‘E:\ABC\PQR\Test.txt’)))) FileName






Posted September 27, 2014 by Izharuddin Shaikh in SQL

Tagged with

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: