A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Merging two tables.



 
 
Thread Tools Display Modes
  #1  
Old September 23rd, 2008, 02:03 PM posted to microsoft.public.access.tablesdbdesign
Chigger Hill
external usenet poster
 
Posts: 17
Default Merging two tables.

I have two databases that do essentially the same thing. Database 1 has its
main table linked to a very large database. Database 2 has its main table
linked to a different large database. These two databases contain
essentially the same information (but not entirely) with different primary
keys. They are lists of employees with different employee numbers for each
table. Is there an easy way of merging these two tables into one database
with a different primary key (assigned)?

I do not use code at all.
--
Chigger Hill
  #2  
Old September 23rd, 2008, 02:56 PM posted to microsoft.public.access.tablesdbdesign
Golfinray
external usenet poster
 
Posts: 1,597
Default Merging two tables.

Could you just import one table into the other database? Try File/get
external data/import. Then go in and assign the keys.

"Chigger Hill" wrote:

I have two databases that do essentially the same thing. Database 1 has its
main table linked to a very large database. Database 2 has its main table
linked to a different large database. These two databases contain
essentially the same information (but not entirely) with different primary
keys. They are lists of employees with different employee numbers for each
table. Is there an easy way of merging these two tables into one database
with a different primary key (assigned)?

I do not use code at all.
--
Chigger Hill

  #3  
Old September 23rd, 2008, 03:04 PM posted to microsoft.public.access.tablesdbdesign
Chigger Hill
external usenet poster
 
Posts: 17
Default Merging two tables.

I have the same employees in both databases with different primary keys for
the same employee in each table. I have employees in one table and not the
other. I need to keep the tables linked because of keeping the data current.
The database that these are linked to are the active employees of two sister
companies that do work in each company.
--
Chigger Hill


"Golfinray" wrote:

Could you just import one table into the other database? Try File/get
external data/import. Then go in and assign the keys.

"Chigger Hill" wrote:

I have two databases that do essentially the same thing. Database 1 has its
main table linked to a very large database. Database 2 has its main table
linked to a different large database. These two databases contain
essentially the same information (but not entirely) with different primary
keys. They are lists of employees with different employee numbers for each
table. Is there an easy way of merging these two tables into one database
with a different primary key (assigned)?

I do not use code at all.
--
Chigger Hill

  #4  
Old September 24th, 2008, 07:26 AM posted to microsoft.public.access.tablesdbdesign
Piet Linden[_2_]
external usenet poster
 
Posts: 280
Default Merging two tables.

On Sep 23, 9:04*am, Chigger Hill
wrote:
I have the same employees in both databases with different primary keys for
the same employee in each table. *I have employees in one table and not the
other. *I need to keep the tables linked because of keeping the data current.
*The database that these are linked to are the active employees of two sister
companies that do work in each company.
--
Chigger Hill

"Golfinray" wrote:
Could you just import one table into the other database? Try File/get
external data/import. Then go in and assign the keys.


"Chigger Hill" wrote:


I have two databases that do essentially the same thing. *Database 1 has its
main table linked to a very large database. *Database 2 has its main table
linked to a different large database. *These two databases contain
essentially the same information (but not entirely) with different primary
keys. *They are lists of employees with different employee numbers for each
table. *Is there an easy way of merging these two tables into one database
with a different primary key (assigned)? *


I do not use code at all.
--
Chigger Hill


The part here that worries me is the "very large database" part. You
theoretically can create a union query that returns all records a
table in the very large DB and the other large db. The problem is
that the performance will *not* be good. At least that way you can
query the tables... I would probably filter the two tables _first_ and
then union those results together - that way you can use the indexing
on the tables. Other than that, I am out of ideas...
  #5  
Old September 24th, 2008, 07:35 PM posted to microsoft.public.access.tablesdbdesign
JimS
external usenet poster
 
Posts: 252
Default Merging two tables.

Couple of issues...

You need to be able to identify the members of each table and be able to
somehow "know" they are the same...SSN, or Last Name, or something. That
becomes a key on which you do not allow duplicates...let's say it's SSN.

Using table1, create a make-table query that creates a new table which
enforces SSN as an index with no duplicates allowed. You don't need code for
this. Then make the table and observe you have no duplicates....

Using table2, create an append query to the combined table that loads up
table2 again observing any duplicate records. You could use the "find
duplicates" wizard to find them, then be sure the duplicate count matches
when you run the append query.

If you need info from table2 other than what was in table1 for the duplicate
records, then you can run an update query to fill in the blanks in the
combined table. Then abandon table1 and table2.

If I understand your requirement, this should meet it....
--
Jim


"Piet Linden" wrote:

On Sep 23, 9:04 am, Chigger Hill
wrote:
I have the same employees in both databases with different primary keys for
the same employee in each table. I have employees in one table and not the
other. I need to keep the tables linked because of keeping the data current.
The database that these are linked to are the active employees of two sister
companies that do work in each company.
--
Chigger Hill

"Golfinray" wrote:
Could you just import one table into the other database? Try File/get
external data/import. Then go in and assign the keys.


"Chigger Hill" wrote:


I have two databases that do essentially the same thing. Database 1 has its
main table linked to a very large database. Database 2 has its main table
linked to a different large database. These two databases contain
essentially the same information (but not entirely) with different primary
keys. They are lists of employees with different employee numbers for each
table. Is there an easy way of merging these two tables into one database
with a different primary key (assigned)?


I do not use code at all.
--
Chigger Hill


The part here that worries me is the "very large database" part. You
theoretically can create a union query that returns all records a
table in the very large DB and the other large db. The problem is
that the performance will *not* be good. At least that way you can
query the tables... I would probably filter the two tables _first_ and
then union those results together - that way you can use the indexing
on the tables. Other than that, I am out of ideas...

  #6  
Old September 25th, 2008, 04:37 PM posted to microsoft.public.access.tablesdbdesign
Chigger Hill
external usenet poster
 
Posts: 17
Default Merging two tables.

Thanks for the info. I have been working along the same lines but went
around the world to get next door. I will continue to refine my solution
using your input.
--
Chigger Hill


"JimS" wrote:

Couple of issues...

You need to be able to identify the members of each table and be able to
somehow "know" they are the same...SSN, or Last Name, or something. That
becomes a key on which you do not allow duplicates...let's say it's SSN.

Using table1, create a make-table query that creates a new table which
enforces SSN as an index with no duplicates allowed. You don't need code for
this. Then make the table and observe you have no duplicates....

Using table2, create an append query to the combined table that loads up
table2 again observing any duplicate records. You could use the "find
duplicates" wizard to find them, then be sure the duplicate count matches
when you run the append query.

If you need info from table2 other than what was in table1 for the duplicate
records, then you can run an update query to fill in the blanks in the
combined table. Then abandon table1 and table2.

If I understand your requirement, this should meet it....
--
Jim


"Piet Linden" wrote:

On Sep 23, 9:04 am, Chigger Hill
wrote:
I have the same employees in both databases with different primary keys for
the same employee in each table. I have employees in one table and not the
other. I need to keep the tables linked because of keeping the data current.
The database that these are linked to are the active employees of two sister
companies that do work in each company.
--
Chigger Hill

"Golfinray" wrote:
Could you just import one table into the other database? Try File/get
external data/import. Then go in and assign the keys.

"Chigger Hill" wrote:

I have two databases that do essentially the same thing. Database 1 has its
main table linked to a very large database. Database 2 has its main table
linked to a different large database. These two databases contain
essentially the same information (but not entirely) with different primary
keys. They are lists of employees with different employee numbers for each
table. Is there an easy way of merging these two tables into one database
with a different primary key (assigned)?

I do not use code at all.
--
Chigger Hill


The part here that worries me is the "very large database" part. You
theoretically can create a union query that returns all records a
table in the very large DB and the other large db. The problem is
that the performance will *not* be good. At least that way you can
query the tables... I would probably filter the two tables _first_ and
then union those results together - that way you can use the indexing
on the tables. Other than that, I am out of ideas...

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:40 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.