I've been asked to improve the efficiency of a data dump as it currently takes forever to run. There's some inherent nastiness that I will be removing, but a thought occurred to me. At the moment it opens a load of streams, and outputs the data line by line. Would it be more efficient to put the data required into temp tables and then to export to the files at the last moment in a nice tight loop?