This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Not a lot of information given in the OP, but traditionally this type of task is done with an ETL. If your using MSSQL you can use Microsoft Data Transformation Services (DTS) or there are open-source tools available that can connect over JDBC to other databases.
Might be more work initially, but will payoff the next time to need to transform data.