I need to copy data from one set of tables (source) to another (destination). In the destination tables, some of the tables have less fields than the source tables (eg. Table2 (has Field1 and Field2) will be copied to Table1 (has only Field 1)). All of the fields in the destination tables are in the respective source tables.
I'd like to use this SQL to do the job for each pair of tables:
SQL = "INSERT INTO Table1 SELECT * FROM Table2 "
, but I get an error complaining that there's nowhere for Field2 to go. Is there a way to have the SQL copy over the data only where the two tables have fields in common without explictly naming the fields? I would rather not have to code something like:
INSERT INTO table1 (field1, field2) SELECT field1, field2 FROM table2....
because some of these tables have 25 fields, and I don't want to have to type each one.
Thank you,
Steve Geller
I'd like to use this SQL to do the job for each pair of tables:
SQL = "INSERT INTO Table1 SELECT * FROM Table2 "
, but I get an error complaining that there's nowhere for Field2 to go. Is there a way to have the SQL copy over the data only where the two tables have fields in common without explictly naming the fields? I would rather not have to code something like:
INSERT INTO table1 (field1, field2) SELECT field1, field2 FROM table2....
because some of these tables have 25 fields, and I don't want to have to type each one.
Thank you,
Steve Geller