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

Breaking down T-SQL requirements (methodology) Expand / Collapse
Author
Message
Posted Saturday, August 9, 2014 8:38 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, September 5, 2014 9:10 PM
Points: 163, Visits: 569
Hello All,

I have a bit of experience with T-SQL and have done a lot of things with it over the years. The one thing that I feel is most of need for me that I am missing is how to approach complex program requirements when designing queries, sprocs, functions etc...

Programmers use mock code to outline the steps to their programs but is there a systematic, step-by-step methodology that you use when designing and working out a SQL problem or can you provide reference to resources?

Thanks!







A clever person solves a problem. A wise person avoids it.
A clever person solves a problem. A wise person avoids it.



A clever person solves a problem. A wise person avoids it. ~ Einstein
select cast (0x5365616E204465596F756E67 as varchar(128))
Post #1601434
Posted Saturday, August 9, 2014 8:47 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, September 5, 2014 9:10 PM
Points: 163, Visits: 569
For your better understanding of what I am thinking it would be something like what this article covers but more in-depth - such that a book could be written about.

[url=https://blogs.oracle.com/jsmyth/entry/building_queries][/url]







A clever person solves a problem. A wise person avoids it.
A clever person solves a problem. A wise person avoids it.



A clever person solves a problem. A wise person avoids it. ~ Einstein
select cast (0x5365616E204465596F756E67 as varchar(128))
Post #1601435
Posted Saturday, August 9, 2014 10:22 AM This worked for the OP Answer marked as solution


SSC-Dedicated

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

Group: General Forum Members
Last Login: Today @ 12:27 PM
Points: 35,371, Visits: 31,916
To be honest, I use "old fashioned" methods such as building either a written flow-chart or, if it's not that complex a problem, a mental flowchart, and then I "peel just on potato" at a time. It's much easier for me to tackle just one block of code at a time than trying to hold the whole thing up in the air while I build a foundation under it.

--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 #1601441
Posted Saturday, August 9, 2014 11:05 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, September 5, 2014 9:10 PM
Points: 163, Visits: 569
That is pretty much the approach I have been seeing everywhere. So I guess it is the way it is done. I just thought maybe someone would have documented a more decision tree like structured flow to the process. Thanks for your reply.








A clever person solves a problem. A wise person avoids it.
A clever person solves a problem. A wise person avoids it.



A clever person solves a problem. A wise person avoids it. ~ Einstein
select cast (0x5365616E204465596F756E67 as varchar(128))
Post #1601445
Posted Saturday, August 9, 2014 2:39 PM


SSC-Dedicated

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

Group: General Forum Members
Last Login: Today @ 12:27 PM
Points: 35,371, Visits: 31,916
TeraByteMe (8/9/2014)
That is pretty much the approach I have been seeing everywhere. So I guess it is the way it is done. I just thought maybe someone would have documented a more decision tree like structured flow to the process. Thanks for your reply.



To ber honest, I've not seen it done that way by many. I've found that a lot of folks just sit down and start hacking with no plan.


--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 #1601457
Posted Saturday, August 9, 2014 3:12 PM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, September 5, 2014 9:10 PM
Points: 163, Visits: 569
What I meant to say was everybody worth listening to :). When a person has to go back into their code after being away from it for a while it makes it much easier when there is a predictable/logical structure to it. I know that helps me.

To ber honest, I've not seen it done that way by many. I've found that a lot of folks just sit down and start hacking with no plan.







A clever person solves a problem. A wise person avoids it.
A clever person solves a problem. A wise person avoids it.



A clever person solves a problem. A wise person avoids it. ~ Einstein
select cast (0x5365616E204465596F756E67 as varchar(128))
Post #1601461
Posted Sunday, August 10, 2014 9:02 AM


SSC-Dedicated

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

Group: General Forum Members
Last Login: Today @ 12:27 PM
Points: 35,371, Visits: 31,916
Ah. Gotcha.

I also enforce a set of fairly strict but very easy to comply with set of standards both at work and upon myself.


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

Add to briefcase

Permissions Expand / Collapse