Hi
I need to query a SQL Server 2000 database and retrieve possibly a million (or even millions of) records, and then "do something" for a number of these records at a time.
i'm trying to figure out the most efficient way to do this:
- connect to the DB numerous times in a loop, and each time retrieve, say, 10,000 records?
- connect just once and bring back a huge dataset?
Is there some way of paging a large result so the network doesnt get a ridiculous amount of traffic in one go?
Any thoughts/pointers/links would be very much appreciated, i am completely stumped despite extensive googling. I've not got that much experience, so i beg forgiveness in advance for any stupidity...
Please let me know if i'm being totally unclear and you need more info!
TIA
I need to query a SQL Server 2000 database and retrieve possibly a million (or even millions of) records, and then "do something" for a number of these records at a time.
i'm trying to figure out the most efficient way to do this:
- connect to the DB numerous times in a loop, and each time retrieve, say, 10,000 records?
- connect just once and bring back a huge dataset?
Is there some way of paging a large result so the network doesnt get a ridiculous amount of traffic in one go?
Any thoughts/pointers/links would be very much appreciated, i am completely stumped despite extensive googling. I've not got that much experience, so i beg forgiveness in advance for any stupidity...
Please let me know if i'm being totally unclear and you need more info!
TIA