Solved

Which faster - recordset or stored procedure?

Posted on 2011-03-16
2
410 Views
Last Modified: 2012-08-14
Hi, we currently have a page that creates a recordset depending on the request query string, roughly as follows:-

If Request("aa") <> "" Then
sql = "Where xxxx = yy"
ElseIf Request("bb") <> "" Then
sql = "Where dddd = cc"
etc

set db = server.createObject("ADODB.Connection")
db.open CONN_STRING

sSQLString = sql
db.Execute(sSQLString)
etc

If we replaced the above with stored procedures as follows, would it be fast or slower?

If Request("aa") <> "" Then
[run SP 1]
ElseIf Request("bb") <> "" Then
[run SP 2]
etc

Thanks!
0
Comment
Question by:pld51
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 33

Accepted Solution

by:
knightEknight earned 500 total points
ID: 35150914
assuming the SPs contained the same queries that would be generated by the code (and all else being equal), I doubt it would make much difference -- but if anything, using the SPs might be a microsecond or two faster (in theory).
0
 

Author Closing Comment

by:pld51
ID: 35152347
thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question