Exforsys

Online Training

Which is Preferred

This is a discussion on Which is Preferred within the ASP forums, part of the Programming Talk category; I was counting the records in my recordset. For doing this there are various ways. I tried with both count() ...


Go Back   Exforsys > Programming Talk > ASP

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-22-2007, 11:08 PM
Senior Member
 
Join Date: Apr 2006
Posts: 141
Adrian is on a distinguished road
Question Which is Preferred

I was counting the records in my recordset. For doing this there are various ways. I tried with both count() and also by using a variable and incremented the variable inside the recordset as the pointer moves on each recordset. Though both fetched the same result my query is whether there is any difference in performance between the two approach and which one is preferred than other. Kindly also state the reason for the same which would help me to get a better idea.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-24-2007, 03:35 PM
Senior Member
 
Join Date: Apr 2006
Posts: 122
rachelle is on a distinguished road
Definitely your first method of using count () is preferred when compared with the other method of using a variable and incremented the variable inside the recordset as the pointer moves on each recordset. This is because the database activity involved with the latter method is much and when you use this in a situation of having number of users with numerous records definitely there would be decrease in performance due to increase in database activity. Also in addition your recordset would be actively kept until you finish the whole process. So comparing all this the best preferred method out of the two suggested is the use of count ().
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new questions
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
SAP BASIS ADMINISTRATOR with minimum 2 yrs of exp AT Atos Origin admin Experienced Job Seekers - India 0 02-15-2006 06:14 AM
Open Positions GE (GTO) kalareddy Experienced Job Seekers - India 0 06-23-2005 07:23 PM
Openings with Deloitte techguru Experienced Job Seekers - India 0 06-03-2005 09:25 PM


All times are GMT -4. The time now is 11:47 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.