Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Need Help TSQL Code. Expand / Collapse
Author
Message
Posted Saturday, August 3, 2013 5:38 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 8:06 PM
Points: 36,785, Visits: 31,243
geoff5 (7/30/2013)
Jeff,

I was mistaken because I looked too quickly over the code and didn't read it properly. My code was neither shorter nor simpler.

I am appropriately abashed.

Geoff


No problem. I thought I was missing something. Thank you for the feedback.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1480741
Posted Saturday, August 3, 2013 5:41 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 8:06 PM
Points: 36,785, Visits: 31,243
Luis Cazares (8/1/2013)
Hi George,
You should really be trying to figure out this yourself by using BooksOnLine (BOL or SQL Server help) but I'll try to explain.
REVERSE will do exactly what it says, returns the reverse order of a string value.
I use it because I need to find the last space in the string. As CHARINDEX won't have a backwards function, I need to reverse the string to get the last space that will become the first one. Was I clear or did I confuse you even more?


To add to that, especially since George is a newbie...

@George, just in case you don't know (a lot of newbies don't), "Books Online" is the "help" documentation that comes with SQL Server. You can easily get there by pressing the {f1} key from SSMS (SQL Server Management Studio).


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1480742
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse