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

TSQL Challenge 78 - Parse single field into multiple fields Expand / Collapse
Author
Message
Posted Sunday, March 18, 2012 10:22 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Tuesday, December 24, 2013 4:42 AM
Points: 460, Visits: 2,523
Comments posted to this topic are about the item TSQL Challenge 78 - Parse single field into multiple fields

.
Post #1268787
Posted Monday, March 19, 2012 1:50 AM


SSC-Dedicated

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

Group: General Forum Members
Last Login: Today @ 7:37 AM
Points: 35,264, Visits: 31,753
This is another contest problem where the best solution wouldn't likely be an "all in one" query.

--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 #1268825
Posted Monday, March 19, 2012 7:23 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Friday, September 26, 2014 12:25 PM
Points: 261, Visits: 913
Jeff Moden (3/19/2012)
This is another contest problem where the best solution wouldn't likely be an "all in one" query.


I suggest the schema should be redesigned and this code would be part of a one-time fix to populate new tables rather than part of ongoing reporting.

I know... this is a vendor's application, entrenched business, just get it done "for today", and a dozen other reasons why we all still have jobs dealing with other people's implementation choices. :)
Post #1268952
Posted Monday, March 19, 2012 7:28 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 8:07 AM
Points: 13,000, Visits: 12,416
LOL. Forget about efficiency I want this in a single query no matter how slow!!!

_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1268957
Posted Monday, March 19, 2012 8:10 AM


SSC-Dedicated

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

Group: General Forum Members
Last Login: Today @ 7:37 AM
Points: 35,264, Visits: 31,753
I know it's just a contest and a lot of the problems are made up but I really worry about things like this. Judging from the number of people with performance questions on this site and the folks/problems I run into in real life, there are enough people that don't understand how bad all-in-one queries can be.

I liked (haven't been there in a while) Phil Factor's "Speed Phreak" challenges a lot better. They allowed folks to use some very effective "Divide-n-Conquer" methods.


--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 #1268984
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse