stored procedures for optimization

Results 1 to 2 of 2

Thread: stored procedures for optimization

  1. #1
    Rob Guest

    Default stored procedures for optimization

    I have been reading up on stored procedures lately.<BR>Particularly how they can speed up an application.<BR>In these articles stored procedures are called <BR>from the page and the actual query is at the database.<BR>But it seems to me every time the query changes, you need<BR>to keep changing the stored proc.<BR><BR>I do not find many articles about this so I am not holding it as <BR>a well known common practice. However I would like to hear from some of you who use them. What is your experience?<BR><BR>Thanks,<BR><BR>Rob<BR><BR>

  2. #2
    Franco Guest

    Default RE: stored procedures for optimization

    R<BR><BR>SPs are definitely the way to go in ASP if you get the chance. ASP script is interpreted i.e. every time it&#039s needed, it&#039s re-compiled from scratch line-by-line. SPs on the other hand are pre-compiled thus speeding things up.<BR><BR>When you say "things keep changing", have you looked at parameters (usually starting with @). In a simple case, you could use an SP to pull out all people whose names begin with a particular letter that you supply:<BR><BR>CREATE PROC mySP<BR>(@strFirstLetterOfForename char(1))<BR>AS<BR>SELECT Surname, Forename, Age FROM ThisTable WHERE LEFT(Forename,1)=@strFirstLetterofForename<BR><BR> Y&#039dig?<BR><BR>Franco<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts