I think VB accessing stored-procedures gets better performance than writting all queries on VB code.
Is it true? I need some articles that prove it.
Thanks.
Also the stored proceudres are compiled by database so they run very quickly (after first call) compared to striaight commandtext queries
Well, usually. If the S/P is going to take a long time to run (> 5 sec, say) then having a precompiled query plan is less important than getting it done right every time, so dynamic SQL doesn't lose much to a stored proc in this instance. It's also less important when (e.g.) an index is not evenly distributed: some queries will resolve well and some not using the same query plan.
Bear in mind that cost-based optimizers don't spend very much time thinking about query plans: small fractions of a second - if they go over their time budget they'll stop and use the best plan found so far.
I'm not saying you're wrong - just that it's not a hard-and-fast rule and developers should be aware of the kind of situations where the approach is suboptimal.
Business rules that involve database operations should
be implemented as stored procedures.
If the operations involve many calculations or complex
flow-control, they should be classes.
Complex (not simple) validations should take place on
the middle tier.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.