![]() |
Linking Database Tables
I am trying to migrate some data from one database to another. The new database's tables have different column names than the old tables.
Is there some tool I can use to link the two tables together that will write queries to export the data and import into the new tables? Because we're taking an average of 70 columns in each table and it's taking a long time to write the queries myself. Thanks. EDIT: Please ask any questions you have. I know my explanation is not very clear. :) |
Re: Linking Database Tables
It might be important to know how the column names are changing.
Is it completely arbitrary? Or are they all changing by a common prefix? For example, do the changes look like so...? :
nickname -> user_nicknameOr... like so? :
nickname -> usernameAnd is this consistent throughout all tables in the database? Does the prefix rule differ? Or is it completely arbitrary for each and every table? |
Re: Linking Database Tables
Quote:
Here are some examples of the column names: :
HrsSinceOvrHl -> HoursSinceOverHaul |
Re: Linking Database Tables
Quote:
I feel for you. It seems like nothing could be faster than whipping up a single php script, to alter every tables' columns, with some SQL queries. http://dev.mysql.com/doc/refman/5.0/en/alter-table.html I don't see how there could be possibly anything faster than that, because either way... you're going to have to type out the name of every column, right? Unless the name of each column already exists on the other database, in which case you could write another script to extract all of the column names, for each table, into some arrays. Then paste those array declarations into the previously mentioned script, handle the arrays properly, effectively speeding up the process of writing out each column name yourself. In other words, even if a tool did exist, I don't see how it could outdue the power and speed of writing some innovative queries yourself. |
Re: Linking Database Tables
Thanks for your help Sane. Greatly appreciated.
|
| All times are GMT -5. The time now is 3:41 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC