Home All Groups Group Topic Archive Search About

Stored procedure Or View

Author
26 Nov 2005 2:53 PM
Taha
hi all
is stored procedure faster then view to retrieve data calculated by function

Author
26 Nov 2005 9:03 PM
m.posseth
Well i do not believe there would be a reall speed difference

however for calling from a program i would still recomend a stored procedure
( security etc etc )

regrds

M. Posseth


Show quote
"Taha" <taha***@hotmail.com> wrote in message
news:em$Uwnq8FHA.4008@TK2MSFTNGP10.phx.gbl...
> hi all
> is stored procedure faster then view to retrieve data calculated by
> function
>
>
>
Author
27 Nov 2005 12:02 AM
Erland Sommarskog
Taha (taha***@hotmail.com) writes:
> is stored procedure faster then view to retrieve data calculated by
> function

I'm not even sure the question is meaningful. If you have a function,
you can call it directly, or embed it into something. Then it also
depends on what sort of function it is. Is it a scalar function or
table-valued? If table-valued, is it inline or multi-statement?

--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Author
27 Nov 2005 2:28 AM
--CELKO--
There is no magic answer. The VIEW will be portable and your can use
DCL for security.  The VIEW will show the entire data set, while a
stored procedure might producea smaller set of  rows based on
parameters.

Generally speaking, I would go with the VIEW for the portability and
not expect there to be much difference in performance, if the procedure
returns the same data as the VIEW.

AddThis Social Bookmark Button