Solved

Which faster - recordset or stored procedure?

Posted on 2011-03-16
2
409 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
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

820 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