Re: Views vs. Stored Procs

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Nags (nags_at_RemoveThishotmail.com)
Date: 12/30/04


Date: Thu, 30 Dec 2004 12:52:39 -0500

But, why should the performance be better when using a procedure ?

-Nags

"Aaron [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:#u0IDIp7EHA.2196@TK2MSFTNGP11.phx.gbl...
> Views are typically not used for performance. They are usually used to
> simplify common joins/queries and or to implement moderate security.
>
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
>
>
> "James" <cppjames@aol.com> wrote in message
> news:eMlsA8o7EHA.1024@TK2MSFTNGP10.phx.gbl...
> > I created a pretty complicated query that joins a number of tables and
> > pivots a table. When I put this in a view, it takes about 6-7 seconds
to
> > run. When I put it into a stored procedure, it only takes about 5
> seconds.
> > Is there any reason to NOT put this into a stored procedure? I guess it
> > begs the question, why use a view at all?
> >
> > Thanks!
> > James
> >
> >
>
>



Relevant Pages

  • Re: Edington UPDATE: "comes to me in the starry nights,"
    ... days after the murder to report her allegations formally. ... Mr. James. ... probably called her husband in a panic as soon as the child told the ... The reason for doing it was to add credibility to ...
    (alt.true-crime)
  • Re: Factoring paper is wrong
    ... > posted on sci.math wants the published paper to remain published, ... James is his own man, as I am my own man. ... theory and branches of math that don't involve numbers for that reason. ... documented in the literature that 3,298,601,216 and all 254 numbers after it ...
    (sci.math)
  • Re: Unanswered Questions
    ... the Potters, ... the reason for his "great remorse" when he later learns that Voldemort ... he owes James a life debt. ... just Harry for some odd reason). ...
    (alt.fan.harry-potter)
  • Re: disk brake debate - summary II
    ... statistic to be found, there's no control group, and every reporter is ... we have some reports that just so happen to correspond with James' ... cannot be proven in a scientific manner. ...
    (rec.bicycles.tech)
  • Re: Question about using ROWLOCK and XLOCK
    ... Well the whole thing should be wrapped in a TRY - CATCH block for proper error handling and that was assumed. ... the record might exist but the update fails for some reason and inserting a second record would cause the insert to fail and the stored procedure to crash. ... When I remove the XLOCK from the SELECT statement in the stored procedure, my stored procedure doesn't interfere with program B but I am concerned that if I don't have ROWLOCK and XLOCK in the WITH clause of the SELECT statement, progam B may delete my updated record before it has been read. ...
    (microsoft.public.sqlserver.programming)