January 8, 2009 at 1:43 pm
Hi All
I have 2 Access database but having different data in it. Is there a way I can pull up the data from both the database in to one database.
FYI the primary Key in both the database are same . Is there a way I can merge the data.
Thanks
Gaurav
January 8, 2009 at 4:42 pm
January 8, 2009 at 5:14 pm
Yes,
Primary keys are autonumber
January 8, 2009 at 5:43 pm
OK! Make third MS Access file then import the both tables from both DB. After that go to querys and open new query in SQL mode then write:
SELECT * FROM TABLE1
UNION ALL
SELECT * FROM TABLE2
Save it as query! These Select statement together with UNION All collect the data in one place, then after you create the query go the query design and create another one but this time as make table query in the current DB put all columns in the query run it, it will creates the new table! So you should design this table just adding one more column with autonumber datatype!
January 8, 2009 at 5:49 pm
simple steps:
After importing the both Tables! Create new query in SQL mode:
SELECT * FROM TABLE1
UNION ALL
SELECT * FROM TEBLE2
Save it as Union_all
then
Start new query also in SQL Mode then write:
This code replace the Make Table Query action!!!
SELECT * INTO FINAL_TABLE
FROM Union_all
January 8, 2009 at 6:02 pm
Thanks for your reply
I was able to merge two table however the final table has no more primary key and also in my database there is a relationship between different tables and I also have lukup tables.
If I merge all the tables by the above method will the relationship still holds gud
January 9, 2009 at 1:00 am
Gaurav (1/8/2009)
Thanks for your replyI was able to merge two table however the final table has no more primary key and also in my database there is a relationship between different tables and I also have lukup tables.
If I merge all the tables by the above method will the relationship still holds gud
On final table you should add one more column with autonumber datatype, so I don't have the info about you relationship between tables but you should know when these two tables have from beginning the autonumber fields that starts from 1!
This action to merge that two tables should be just for any collection of the data or just for analyzing something with these data! Anyway they are not available to use with other tables in relationship before, because in Final Table you have the values that they are not unique anymore!
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply