Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SIMPLY COMBINING 2 TABLES

Status
Not open for further replies.

vito0818

MIS
Jul 24, 2002
2
US
I have two tables that I would like to combine into one new table. When updating a table, I accidently updated my back up copy on a disk. I have already deleted all the records from the back up copy that I did not just update (the records that were there from before) so I now have two tables that have no overlapping data. I just want to combine those two tables, but I am having trouble. Because I was using two identical tables, all the column names and acceptable values (strings, integers etc) are exactly the same. I thought it sounded pretty simple, but after a while of playing around, I am stumped.
 
Do you have an AutoNumber field in the table (s) ?

If not then:-
Create a new Query

In SQL view type

INSERT INTO tblA
SELECT tblB.*
FROM tblB;

Where tblA is the target and tblB is the datasource.

Then Run the query.

###########
If you do have an autonumber field then you'll need
INSERT INTO tblA
SELECT field2, field3, field4 .. .. etc . . .
FROM tblB;

Where field2, field3 etc are all of the field names except the Autonumber field.
############


Job Done


QED.

G LS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top