Merging databases

D

DannyJ

Dear All,

I have two tables in different databases. Both tables contain fileds a, c
and e. However one table also includes fields b and d. I would like to
import the data from the smaller table into the bigger one but am unsure how
to do it. I suppose I could export the data from the smaller table to an
excel spreadsheet, add the missing columns, and then import it into the
larger table but it seems rather inelegant.

any suggestions?

Many thanks,

Danny
 
G

Guest

Open the DB where the bigger table is, link the small table, you dont have to
import it, create an insert query to insert all the values from the small
table into tha big one.
 
D

David Lloyd

Danny:

One option would be to write a query similar to the following:

INSERT INTO BiggerTable (A, C, E)
SELECT A, C, E
FROM SmallerTable
IN "C:\SmallerTableDB.mdb"

This query assume that you have defaults set for fields B and D. If not you
can change the query to something like:

INSERT INTO BiggerTable (A, B, C, D, E)
SELECT A, "", C, "", E
FROM SmallerTable
IN "C:\SmallerTableDB.mdb"

This second query assumes B and D are text fields.

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


Dear All,

I have two tables in different databases. Both tables contain fileds a, c
and e. However one table also includes fields b and d. I would like to
import the data from the smaller table into the bigger one but am unsure how
to do it. I suppose I could export the data from the smaller table to an
excel spreadsheet, add the missing columns, and then import it into the
larger table but it seems rather inelegant.

any suggestions?

Many thanks,

Danny
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top