SqlShare.com Logo
 
Skip Navigation Links
Home
Video List
Events
Classes
About Us
Login / Register
Subscribe RSS Feed 

Idera SQL Check

String Handling Functions Part 7

Reverse! I've used this as an interview questions many times, challenging a candidate to reverse a string using code. It's a good way to test basic string skills. It's posible to do it with no code in TSQL, which doesn't make for much of a test (assuming you know the function exists). But is it useful beyond that? The answer is a definite yes, you'll find times when having a built-in REVERSE can enable some very elegant solutions to string problems.

Duration:
5 mins 9 secs
Skill Level:
100
Rating:
4.44 out of 5
Publish Date:
October 23, 2010
String Handling Functions Part 7 You must be logged in to view this video.  
Bookmark and Share
 
1=Poor, 3=Good, 5=Excellent

About the Author

Image of Andy Warren
Andy Warren is a software trainer focusing on SQL Server, a member of the PASS Board of Directors, and a principal in this site - SQLShare.com.

References



Comments
tomaz.tsql on 10/25/2010
this is even a simpler method: declare @email varchar(50) = 'webmaster@sqlshare.nz' print reverse(reverse(parsename(@email,1)))

tomaz.tsql on 10/25/2010
this is even simpler version to last bits of email out: declare @email varchar(50) = 'webmaster@sqlshare.nz' print reverse(reverse(parsename(@email,1)))

Charlie Bruno on 10/26/2010
Informative. I cannot wait to use this on an interview.

Stephen on 10/26/2010
Nice

Peggy on 10/26/2010
great to know instead of using long parsing routines

Terrance on 10/26/2010
Never knew that there was a reverse function.

Yelena Varshal on 10/26/2010
Thanks!

Ed Svastits on 10/26/2010
Too bad there isn't a revcharindex() function in T-SQL. Perhaps in SQL Server 2011?

Kenneth Wymore on 10/26/2010
Great video! Excellent examples of how reverse could be used.

Rod on 10/26/2010
Never knew about the REVERSE function in T-SQL. Thank you!

Leonard Peoples on 10/26/2010
Very helpful.

Martin Miller on 10/26/2010
Good technique for getting the last (rightmost) instance of a character. Thanks Andy.

James Lim on 10/26/2010
Good Information. I don't work with strings that often, and I can see the advantages of using the reverse function.

Sean on 10/26/2010
This will help with the SQL challenge to get all the email addresses out of long text string.

Dexter Jones on 10/26/2010
Good coverage of an often-overlooked tool and how it can simplify one's TSQL code.

Mohamed Irshad on 10/26/2010
cool

kalapala baburao on 10/27/2010
ok

Max on 10/27/2010
I never knew about this function, Thanks for the video, Had a thought, what about a ".co.uk" example? Your example would just return the "uk"

Todd Burrell on 10/27/2010
Nice job of incorporating the use of charindex to sort of close the loop on the charindex video from a couple of weeks ago by showing an application for it.

Don Weigend on 10/27/2010
Excellent tip, thank you!

Olu on 10/28/2010
That was simply the best of all the string functions tutorials so far. I particularly found the practical uses of it very, very helpful. Keep it coming.

Calvin Johnson on 10/28/2010
Cool

Steve Harris on 10/28/2010
good examples

Cheryl on 10/28/2010
Excellent - never knew REVERSE existed.

GParvathesam on 11/1/2010
-

Kat on 11/21/2010
Great information.

Derek on 2/18/2011
What a neat trick! I never would have thought of using the REVERSE function for something like that. It would have helped me 6 months ago on another project I was doing.

srinu on 3/8/2011
Its good

ramesh on 4/27/2011
superrrrrrrrrrrrr...........

Ashish on 5/12/2011
cool video..shows things to do in different way

Current on 6/19/2011
good analysis



Must Be Logged In
 

How Do I Become a Video Author? |  Newsletter History

Copyright © Fourdeuce, Inc., 2005-2009. All Rights Reserved | Privacy Policy | Terms & Conditions