Is it a problem if i query again and again to SQL Server 2005 and 2000?

Posted by learner on Stack Overflow See other posts from Stack Overflow or by learner
Published on 2010-06-08T14:15:46Z Indexed on 2010/06/08 14:22 UTC
Read the original article Hit count: 178

Filed under:
|
|

Window app i am constructing is for very low end machines (Celeron with max 128 RAM). From the following two approaches which one is the best (I don't want that application becomes memory hog for low end machines):-

Approach One:-

Query the database Select GUID from Table1 where DateTime <= @givendate which is returning me more than 300 thousands records (but only one field i.e. GUID - 300 thousands GUIDs). Now running a loop to achieve next process of this software based on GUID.

Second Approach:-

Query the database Select Top 1 GUID from Table1 where DateTime <= @givendate with top 1 again and again until all 300 thousands records done. It will return me only one GUID at a time, and I can do my next step of operation.

What do you suggest which approach will use the less Memory Resources?? (Speed / performance is not the issue here).

© Stack Overflow or respective owner

Related posts about c#

Related posts about sql-server