RE: Merging 9 stand alone Databases



If you delete the relationship, change the autonumber field to number,
recreate the relationship, and then run the update query, you should be fine.

HTH,
Chris

"cbrashear" wrote:

The problem is I can not change the auto number field to number with the
relationships intact
--
Cbrashear


"Jerry Whittle" wrote:

First make complete backups of all the databases just in case things go wrong.

Next make sure that any joins between the tables have Referential Integrity
enabled and Cascade Update selected. RI with Cascade Update should
automatically take care of updating any FK fields in child tables. That way
you won't need to break relationships.

Then change the autonumber PK fields to Numbers EXCEPT for in the master
table where you are going to pour in all the data. You can't change a number
field to an Autonumber PK once there is data in the table.

Now starting with the topmost parent table, change the primary key field by
adding an appropriately large number to it. In the case below, 100000 would
be the first table. Then use 200000 for the second table. And so on something
like below.

UPDATE tblstudent SET tblstudent.studentid = [studentid]+100000;

Work down to any child tables that also need their PK updated.

Then you should be able to import all the data from similar tables into one
Starting with the parent tables first
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

"cbrashear" wrote:

I have inherited 9 stand alone databases that need to be merged into one
package.
The problem is the auto number it is the primary key and unique Identifier
for aprox 20 tables in each database. Each database structure is identical so
when I merge the first set of data tables into the master I have no problems,
but after this I can not merge the additional databases sucsessfully. The
data comes in but does not look for its offsprings

Example

tblstudent
field studentID is a auto number

tblworkhistory

field studentID pulls auto number from tblstudent

Except all 9 database have auto number 1 in tblstudent. Now all nine attach
studentId to the first merged database in the master.

I believe I must go into each database and break all relationships. Then
change the auto number fields to number in all tables that have one to many
relationships. Next reestablish all relationships back to cascade update.
Next I would Renumber all old autonumber fields being sure the numbers are
higher than the preceding database. Lastly I would merge all tables into
master database which is still set as a auto number

This is the only way extemely time consuming. Am I on the right page or am I
making it to hard
--
Cbrashear
.



Relevant Pages

  • RE: Merging 9 stand alone Databases
    ... Then change the autonumber PK fields to Numbers EXCEPT for in the master ... Jerry Whittle, Microsoft Access MVP ... The problem is the auto number it is the primary key and unique Identifier ... Each database structure is identical so ...
    (microsoft.public.access.tablesdbdesign)
  • RE: Merging 9 stand alone Databases
    ... Then change the autonumber PK fields to Numbers EXCEPT for in the master ... The problem is the auto number it is the primary key and unique Identifier ... Each database structure is identical so ... field studentID pulls auto number from tblstudent ...
    (microsoft.public.access.tablesdbdesign)
  • Autonumber duplication between tables on the desktop and a PDA
    ... PC running in Windows Mobile 2005. ... The mobile database is built using Visual ... two possible scenarios for specifying separate ranges for Autonumber fields ... data on the desktop device it starts the autonumber field at the next ...
    (microsoft.public.access.tablesdbdesign)
  • Autonumber duplication for referenced tables between desktop and P
    ... PC running in Windows Mobile 2005. ... The mobile database is built using Visual ... two possible scenarios for specifying separate ranges for Autonumber fields ... data on the desktop device it starts the autonumber field at the next ...
    (microsoft.public.access.formscoding)
  • Re: Autonum problem
    ... Make a backup copy of the database, then run compact and repair on ... query and that query has the autonumber field in the field list. ... Jet will let you assign numbers to an autonumber field by an append query, ... The append query does not have the autonumber field as an output field. ...
    (microsoft.public.access.tablesdbdesign)

Quantcast