Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.oracle -> Re: Oracle VS SQL Server - Which is best to back end ?

Re: Oracle VS SQL Server - Which is best to back end ?

From: Erland Sommarskog <esquel_at_sommarskog.se>
Date: Wed, 30 Jun 2004 22:20:34 +0000 (UTC)
Message-ID: <Xns951933878E56Yazorman@127.0.0.1>

Hans Forbrich (forbrich_at_yahoo.net) writes:
> A very common mistake in RDBMS programming include using ANY procedural
> language where pure SQL will accomplish the task. I have seen many
> instances of T-SQL and PL/SQL that were totally unnecessary - and both
> will be considerably slower than pure SQL if the ask can be accomplished
> in pure SQL.
 

I can't assess this for Oracle (that's PL/SQL, isn't it?), but for T-SQL this is not really true, although it may be a more a poor choice of words than an actual misunderstanding.

If you say    

   CREATE PROCEDURE get_some_data @par1 int,

                                  @par2 datetime, ... AS
   SELECT ....
   FROM ... You are certainly using more than "pure SQL". There are several reasons why you package things in stored procedures. Security is one reason, but you also do it for performance, as this increase the use of cached plans.

Of course, if you start to do iterations and take one row at a time for some procession, for something you can have done in one SQL statement, you are losing performance. Then again, far from all T-SQL procedures include iterations, still they can be quite long, if they include complex updates and calculations.                          

-- 
Erland Sommarskog, SQL Server MVP, esquel_at_sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
Received on Wed Jun 30 2004 - 17:20:34 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US