![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Sexy Programmer
|
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. ![]()
__________________
I would love to change the world, but they won't give me the source code! |
|
|
|
|
|
#2 |
|
Programming Guru
![]() |
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_nickname birthday -> user_birthday Or... like so? nickname -> username birthday -> dmy_birth And is this consistent throughout all tables in the database? Does the prefix rule differ? Or is it completely arbitrary for each and every table? |
|
|
|
|
|
#3 | |
|
Sexy Programmer
|
Re: Linking Database Tables
Quote:
Here are some examples of the column names: HrsSinceOvrHl -> HoursSinceOverHaul TGateA -> TimingGateA TGB -> TimingGateB BR_1 -> Bearing1
__________________
I would love to change the world, but they won't give me the source code! |
|
|
|
|
|
|
#4 | |
|
Programming Guru
![]() |
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. |
|
|
|
|
|
|
#5 |
|
Sexy Programmer
|
Re: Linking Database Tables
Thanks for your help Sane. Greatly appreciated.
__________________
I would love to change the world, but they won't give me the source code! |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Storing BLOBs in a database - problem | jonyzz | Other Programming Languages | 8 | Jan 31st, 2007 4:38 AM |
| Linking 2 tables | gj15987 | Delphi | 1 | Nov 4th, 2005 7:42 AM |
| java and MS Access database | borceivanovski | Java | 0 | Apr 26th, 2005 4:28 PM |
| Using ODBC to connect to a remote database in a C program | bigi | C++ | 1 | Mar 8th, 2005 3:19 PM |