Based on your description
I need to iterate a result set, do some simple processing on it and then write that processed data to a file or even a database.
I'm wondering if it wouldn't be easier to load the data directly into the database and call a stored procedure to do "some simple processing".
It depends on what that "simple processing" actually is...