Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Programming
»
General
»
Reverse string without built in functions
29 posts, Page 2 of 3
««
1
2
3
»»
Reverse string without built in functions
Rate Topic
Display Mode
Topic Options
Author
Message
RBarryYoung
RBarryYoung
Posted Wednesday, April 15, 2009 1:53 PM
SSCrazy Eights
Group: General Forum Members
Last Login: Saturday, May 04, 2013 11:13 AM
Points: 9,855,
Visits: 9,374
This is actually from Jacob Sebastiens Challenge #3, where the actual rules were: "Write a single query that can reverse the strings in this column without using the REVERSE() function".
-- RBarryYoung
,
(302)375-0451
blog:
MovingSQL.com
, Twitter:
@RBarryYoung
Proactive
Performance Solutions, Inc.
"Performance is our middle name."
Post #697881
pshvets
pshvets
Posted Wednesday, April 15, 2009 3:48 PM
Valued Member
Group: General Forum Members
Last Login: Friday, February 18, 2011 10:54 AM
Points: 54,
Visits: 154
My question is not a homework question. :)
My background is BI Development on Oracle, Teradata, Unix platforms. I am simply learning MS SQL Server and T-SQL.
And thanks for all your help!
Pit.
Post #697991
Michael Valentine Jones
Michael Valentine Jones
Posted Wednesday, April 15, 2009 4:09 PM
SSCrazy
Group: General Forum Members
Last Login: Yesterday @ 3:14 PM
Points: 2,941,
Visits: 10,481
Maybe you should learn to use what is available in SQL Server, like REVERSE, instead of spending time duplicating what is already available.
Post #698005
GSquared
GSquared
Posted Thursday, April 16, 2009 7:01 AM
SSCoach
Group: General Forum Members
Last Login: Monday, May 06, 2013 1:09 PM
Points: 15,439,
Visits: 9,569
Michael Valentine Jones (4/15/2009)
Maybe you should learn to use what is available in SQL Server, like REVERSE, instead of spending time duplicating what is already available.
Nah. One of the best ways to learn the tricky parts of any engineering tool (and programming languages are definitely engineering tools) is to work out how to do something without using a pre-built answer.
Nails and screws are awefully convenient, but it's fun and educational to build a wooden cabinet without using any. Take away wood glue also, and it's a challenge for even a good woodworker, and fun. And it teaches you techniques you can use in other applications that might be more practical.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Post #698366
jcrawf02
jcrawf02
Posted Friday, April 17, 2009 7:53 AM
SSCrazy
Group: General Forum Members
Last Login: Yesterday @ 12:36 PM
Points: 2,549,
Visits: 18,880
GSquared (4/16/2009)
Michael Valentine Jones (4/15/2009)
Maybe you should learn to use what is available in SQL Server, like REVERSE, instead of spending time duplicating what is already available.
Nah. One of the best ways to learn the tricky parts of any engineering tool (and programming languages are definitely engineering tools) is to work out how to do something without using a pre-built answer.
Nails and screws are awefully convenient, but it's fun and educational to build a wooden cabinet without using any. Take away wood glue also, and it's a challenge for even a good woodworker, and fun. And it teaches you techniques you can use in other applications that might be more practical.
Pshaw! That's no challenge, just use duct tape.
---------------------------------------------------------
How best to post your question
How to post performance problems
Tally Table:What it is and how it replaces a loop
"stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."
Post #699436
GSquared
GSquared
Posted Friday, April 17, 2009 8:30 AM
SSCoach
Group: General Forum Members
Last Login: Monday, May 06, 2013 1:09 PM
Points: 15,439,
Visits: 9,569
jcrawf02 (4/17/2009)
GSquared (4/16/2009)
Michael Valentine Jones (4/15/2009)
Maybe you should learn to use what is available in SQL Server, like REVERSE, instead of spending time duplicating what is already available.
Nah. One of the best ways to learn the tricky parts of any engineering tool (and programming languages are definitely engineering tools) is to work out how to do something without using a pre-built answer.
Nails and screws are awefully convenient, but it's fun and educational to build a wooden cabinet without using any. Take away wood glue also, and it's a challenge for even a good woodworker, and fun. And it teaches you techniques you can use in other applications that might be more practical.
Pshaw! That's no challenge, just use duct tape.
Well, I've found that when you try to use duct tape to reverse a character string, it leaves bits of glue all over your hard drives, and that's a bit of a problem...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Post #699473
Vijaya Kadiyala
Vijaya Kadiyala
Posted Friday, April 17, 2009 9:09 AM
SSCommitted
Group: General Forum Members
Last Login: Monday, October 25, 2010 6:09 AM
Points: 1,621,
Visits: 409
check out the below link, This will give you the function to reverse a string with out using REVERSE.
http://blog.sqlauthority.com/2007/05/01/sql-server-user-defined-functions-udf-to-reverse-string-udf_reversestring/
I always prefer to use existing functions, if they are available instead of duplicating the function.. but again on the other had if we try to duplicate the logic it will increase our programming capabilities :
I am confusing
Thanks -- Vijaya Kadiyala
www.dotnetvj.com
SQL Server Articles For Beginers
Post #699507
RBarryYoung
RBarryYoung
Posted Friday, April 17, 2009 10:13 AM
SSCrazy Eights
Group: General Forum Members
Last Login: Saturday, May 04, 2013 11:13 AM
Points: 9,855,
Visits: 9,374
jcrawf02 (4/17/2009)
GSquared (4/16/2009)
Michael Valentine Jones (4/15/2009)
Maybe you should learn to use what is available in SQL Server, like REVERSE, instead of spending time duplicating what is already available.
Nah. One of the best ways to learn the tricky parts of any engineering tool (and programming languages are definitely engineering tools) is to work out how to do something without using a pre-built answer.
Nails and screws are awefully convenient, but it's fun and educational to build a wooden cabinet without using any. Take away wood glue also, and it's a challenge for even a good woodworker, and fun. And it teaches you techniques you can use in other applications that might be more practical.
Pshaw! That's no challenge, just use duct tape.
Hmm, interesting idea...
-- RBarryYoung
,
(302)375-0451
blog:
MovingSQL.com
, Twitter:
@RBarryYoung
Proactive
Performance Solutions, Inc.
"Performance is our middle name."
Post #699563
ChrisM@Work
ChrisM@Work
Posted Friday, April 17, 2009 10:17 AM
SSCertifiable
Group: General Forum Members
Last Login: Yesterday @ 8:21 AM
Points: 5,602,
Visits: 10,950
Pinal Dave's reverse function has this code in it:
RETURN (REVERSE(@StringToReverse))
“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.”
- Gail Shaw
For fast, accurate and documented assistance in answering your questions, please read
this article
.
Understanding and using APPLY, (I)
and
(II)
Paul White
Hidden RBAR: Triangular Joins
/
The "Numbers" or "Tally" Table: What it is and how it replaces a loop
Jeff Moden
Exploring Recursive CTEs by Example
Dwain Camps
Post #699567
Michael Valentine Jones
Michael Valentine Jones
Posted Friday, April 17, 2009 1:07 PM
SSCrazy
Group: General Forum Members
Last Login: Yesterday @ 3:14 PM
Points: 2,941,
Visits: 10,481
OK, as long as we are doing useless SQL, I want to add numbers together without using any Arithmetic, Logical, Assignment, String, Bitwise, or Unary Operators or any Mathematical or Aggregate Functions.
Post #699709
« Prev Topic
|
Next Topic »
29 posts, Page 2 of 3
««
1
2
3
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.