Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I import old data into an updated database??

Status
Not open for further replies.

darthsiddeous

Programmer
Jan 23, 2000
4
CA
Hello!<br>
I've just finished fixing and updating a database for a client. Now they want to put the old data into the new data base! How can I do it without losing data?? The databases are very similar, it's just that They had me rename a lot of the fields in the tables, and add some new ones! Anyone have any ideas?? (there are @ 11,000 records to be put in......)<br>
<br>

 
You can create a &quot;Append&quot; Query which will allow you to add records from one table to another and decide which fields go where.<br>
Open the Query grid and click &quot;Query&quot; Menu then &quot;Append Query&quot; (it's a green Plus sign)<br>
<br>
It will ask you which table to append to choose your newly modified table.<br>
Next add the old table so it shows where the table go.<br>
Now add a field down in the grid from the old table.<br>
You will see, or you can pick a destination field in the new table in the &quot;append to&quot; field area. If nothing shows up click the append to field and click the down arrow you will see a list of all fields in the NEW table.<br>
If you want to add something to a field and there is NO field in the old table you can type &quot;Expr1: &quot;Florida&quot;.<br>
say if you were adding to a state field. It will put the word Florida say, in every new record appended.<br>
After you have all of the fields listed below.<br>
Run it and it will tell you how many records are being added.<br>
NOTE: It is wise to make a copy of your new table and call it your table name &quot;-Backup&quot; (Prior to Appending new records) because if you add something incorrectly you CANNOT undo it.<br>
If you make a copy and screw it up you can delete the original and copy the backup back to the original.<br>
<p> DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br>
 
Just a note, you may find it easier to do error checking if you make a copy of the target table (structure only) and append to that while testing. That way your old data won't be intermixed with your new data. If you don't sort as you add it's pretty easy to put the old and new table up on the screen together to quickly scan them.<br>
<br>
What I sometimes do also is add an extra field to the new table as DougP mentioned in the Florida example. I use a checkbox named something like OldData and set it to yes/on when I fill in all the old data. That way if there's any question you can always identify (delete, etc.) the old data.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top