Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: Database: MS SQL Server
 Stored Procedures vs Getrows
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Podge
Support Moderator

Ireland
3776 Posts

Posted - 22 December 2004 :  08:49:17  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
http://forum.snitz.com/forum/topic.asp?TOPIC_ID=53090&SearchTerms=stored,procedure

Inspired by the topic above I did a little testing. My idea was to move the database stuff (including strsql building) to a function possibly in a file called inc_sp_functions.asp e.g.

function getCategories

select case strDBType

case “access”
‘build strsql and execute

case “mysql”
‘build strsql and execute

case “sqlserver”
‘don’t build strsql – execute stored procedure instead

end select

As a first step I created about 12 stored procedures (some dynamic but mostly not) which was easy enough to do for default.asp, active.asp, inc_header.asp and search.asp.

For testing purposes, to execute the stored procedures I didn’t change the current code very much, just changed strsql to database.dbo.sproc_name e.g.

‘……………snipped code
allowSql = "mydatabase.dbo.allowsql"
rsAllowed.open allowSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
‘…….snipped code

The result? It made very little difference. I only noticed a slight improvement when I commented out the strsql building code.

http://www.forumco.com/support/default.asp (stored procedures)
http://www.forumco.com/support/default2.asp (normal)

http://www.forumco.com/support/active.asp (stored procedures)
http://www.forumco.com/support/active2.asp (normal)

http://www.forumco.com/support/search.asp (stored procedures - only supports one search term)
http://www.forumco.com/support/search2.asp (normal)

As far as I can see getrows is as fast as stored procedures on the forum above and the only real benefit would be the separation of the database specific code from the rest of the forum code.

Thoughts?

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.

Edited by - Podge on 22 December 2004 08:50:54

PeeWee.Inc
Senior Member

United Kingdom
1893 Posts

Posted - 22 December 2004 :  09:30:27  Show Profile  Visit PeeWee.Inc's Homepage
well, my first thought is about the error i get on active.asp (sp)


Microsoft OLE DB Provider for SQL Server error '80040e14'

Could not find stored procedure 'supportforums.dbo.allowsql'.

/support/active.asp, line 202

De Priofundus Calmo Ad Te Damine
Go to Top of Page

Podge
Support Moderator

Ireland
3776 Posts

Posted - 22 December 2004 :  09:42:11  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
Sorry about that. I should have checked it while I was logged out.

Fixed now.

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 22 December 2004 :  09:47:35  Show Profile  Visit D3mon's Homepage
Note that Getrows and Stored procedures are two very different things. Stored Procedures speed up (sometimes) how quickly the database can collect together the information you request in your query - whereas Getrows speeds up (sometimes) the way ASP handles the data that comes back from the database.

IMO, both only start to produce tangeable speed advantages where large amounts of data are collated (in database) and handled (in ASP). Unless your forums are very large, then I'd be surprised if you saw any benefits.


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.72 seconds. Powered By: Snitz Forums 2000 Version 3.4.07