posted 18 years ago
The approach is similar here: query, execute, handle. The "handle" part would consist of inserting the data into a different DB. If there are many rows, you might use batch inserts instead of inserting them row by row, or at the least not committing them one by one, but only every 1000th row or so.
One thing to consider is primary key IDs. From your post it's not clear whether you might be able to use the same keys in both tables, or whether you need to create new ones (in which case foreign keys would no longer work).