Insert a table form one database into another

D

Dave

I have identical table structures in two databases, one on a client side and
the other on the server side. I want to run an asp query that will take all
of the records from the client and push them into the server db.

Is this a Insert command that I have to loop for each record, if so how?

I have seen Insert Select queries talked about in this forum, will this push
the data into a server db?

I need help getting started.

Thanks
 
J

John Vinson

I have identical table structures in two databases, one on a client side and
the other on the server side. I want to run an asp query that will take all
of the records from the client and push them into the server db.

Is this a Insert command that I have to loop for each record, if so how?

I have seen Insert Select queries talked about in this forum, will this push
the data into a server db?

I need help getting started.

Thanks

An APpend query will do the trick here:

INSERT INTO hosttable
SELECT ([field], [field], [field], ...)
FROM localtable;


John W. Vinson[MVP]
 
D

Dave

Can this be:

INSERT INTO hosttable
SELECT *
FROM localtable;

Do I need to reference the database name or is that handled by the recordset
connection?

Thanks



John Vinson said:
I have identical table structures in two databases, one on a client side
and
the other on the server side. I want to run an asp query that will take
all
of the records from the client and push them into the server db.

Is this a Insert command that I have to loop for each record, if so how?

I have seen Insert Select queries talked about in this forum, will this
push
the data into a server db?

I need help getting started.

Thanks

An APpend query will do the trick here:

INSERT INTO hosttable
SELECT ([field], [field], [field], ...)
FROM localtable;


John W. Vinson[MVP]
 
J

John Vinson

Can this be:

INSERT INTO hosttable
SELECT *
FROM localtable;

Do I need to reference the database name or is that handled by the recordset
connection?

Either way. If you've used ODBC or Tools... Get External Data... Link
to link to an external table, that linked table can be used in very
much the same way as a local table; or you can use the IN operator in
the SQL statement to dynamically link to a connected table.

John W. Vinson[MVP]
 
Top