Solved

Which faster - recordset or stored procedure?

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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

631 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