I am using an SQLServer DB with 1 million or more records to process. I want
to get only a batch of records to process at a time. Apparently the GetRows
method would be the appropriate method to use to do this. What I don't understand
is the following: 1)If I want to get all the fields, how do I do this with
the Fields parameter? 2)If I use this method will the rest of my code for
interfacing with the recordset to assign values to the fields work the same?
3)If I use this method, I only want to update the actual database when I
am finished processing the batch. Should I use the UpdateBatch method after
completion of processing all the records in the batch? Should I not use the
Update method after assigning new values to the fields in the Recordset that
I have aquired with the GetRows method?
Thanks for any help,
Jason
03-28-2002, 08:11 PM
Jason
Re: GetRows method
"Jason West" <jvwest@northstate.net> wrote:
>
>Greetings,
>
>I am using an SQLServer DB with 1 million or more records to process. I
want
>to get only a batch of records to process at a time. Apparently the GetRows
>method would be the appropriate method to use to do this. What I don't understand
>is the following: 1)If I want to get all the fields, how do I do this with
>the Fields parameter? 2)If I use this method will the rest of my code for
>interfacing with the recordset to assign values to the fields work the same?
>3)If I use this method, I only want to update the actual database when I
>am finished processing the batch. Should I use the UpdateBatch method after
>completion of processing all the records in the batch? Should I not use
the
>Update method after assigning new values to the fields in the Recordset
that
>I have aquired with the GetRows method?
>
>Thanks for any help,
>Jason
Jason,
I don't think you'd want to use the GetRows method in this case. It sounds
like you want to update the 1 million records in the database. GetRows is
more for extracting the rows out into an array and doing some form of transformation
on them. Yes you should think about using the UpdateBatch method using a
client-side cursor. If you are using a BatchOptimistic update mode, calling
the recordset Update method will not send data to the database, instead it
just puts the values into the recordset (it's not really necessary). You'd
definitely want to break your processing up into a number of chunks.