Solved

Which faster - recordset or stored procedure?

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel 2016 loop through 6 35
View SQL 2005 Job package 16 40
how to Classify of email (pdf attachments) 7 33
Dcount using a date in a table compared to today's date 3 27
If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

813 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now