Re: VB - Stored Procs vs queries
From: Louis Davidson (dr_dontspamme_sql_at_hotmail.com)
Date: 04/20/04
- Next message: Daniel P.: "Re: Deadlock on Indexed view"
- Previous message: Keith Kratochvil: "Re: How to truncate?"
- In reply to: Deepak: "Re: VB - Stored Procs vs queries"
- Next in thread: Carl Imthurn: "Re: VB - Stored Procs vs queries"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 20 Apr 2004 09:39:29 -0500
One thing to note here. Sometimes the truth is that procedures can make
things more difficult than just sending queries, and sometimes it can be
hard to optimize a query using a stored procedure. But if you hit this kind
of wall, realize one thing. Every time this question is asked here in this
group, no one ever says, "stored procedure suck, don't use them." In fact
we try to give ideas to make them work in all cases.
Tom and Deepak' reasons are excellent, and for me, troubleshooting is the
best part. The user can only touch the database using a strict, specific
interface so I can test this interface. It gives complete control, and
easier testing a year from now when something is going slow.
-- ---------------------------------------------------------------------------- Louis Davidson (drsql@hotmail.com) Compass Technology Management Pro SQL Server 2000 Database Design http://www.apress.com/book/bookDisplay.html?bID=266 Note: Please reply to the newsgroups only unless you are interested in consulting services. All other replies will be ignored :) "Deepak" <letsdotnet@hotmail.com> wrote in message news:eHyCzLtJEHA.3848@TK2MSFTNGP09.phx.gbl... > Hey Chris, > Stored procedures are always a better choice when executing code from a tier > other than data. One of the benefits you will get is that stored procedures > are pre-compiled and thus enhance performance. > > -- > With Regards, > > > Deepak > [I code, therefore I am] > > "Chris Whitehead" <cwmsdn@distinctive-systems.com> wrote in message > news:OmEQfwsJEHA.4072@TK2MSFTNGP12.phx.gbl... > > I'm about the start a new project which is a VB 6 application connection > to > > SQL Server 2000 using ADO. My question is when I is best to use stored > > procedures to return a query as opposed to running the query through code > > using a commandtext? > > > > If I am processing a large query, I presume it's better to do it with a > > stored procedure passing though a few parameters instead of sending the > > whole SQL query through a command text? Correct? > > What about small queries? For example if I want to do "SELECT ProductName > > FROM Products WHERE ProductID = 'Car'" then am I best doing this with a > > commandtext or should I use a stored procedure and simply pass through the > > ProductID as a parameter? > > > > I am just after some guidelines on how best to optimize. Thanks. > > > > Chris > > > > > >
- Next message: Daniel P.: "Re: Deadlock on Indexed view"
- Previous message: Keith Kratochvil: "Re: How to truncate?"
- In reply to: Deepak: "Re: VB - Stored Procs vs queries"
- Next in thread: Carl Imthurn: "Re: VB - Stored Procs vs queries"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|