Combine tables problem

  • Thread starter Thread starter RC
  • Start date Start date
R

RC

Hi,

When I want to combine, say 10 tables, each table contain
about 150 rows of data, the rows of data get mixed.
That means maybe in row 220 of the new table, it should be
the data of table 2, but a row of data from table 3
appear. Althrough all the data from the 10 tables had been
copied to the correct table, the output is not desired.
Anyone can suggest a solution? Thanks!

My code:
SELECT * INTO [server] FROM table 1 'first, I created the
new table using table
INSERT INTO [server] SELECT * FROM table(2,3,4...) 'Then
copy the data in other tables into the destinated table.

Regards,
RC
 
Besides, would you please also suggest a method to
completely remove a column in a table.
Thanks!!
 
Simple solution would be to open the table, highlight the
column, right click and choose 'cut'.

I take it that the primary key in all these tables is the
same? In that case, either you are not honoring
referential integrity or the key of that one record in
table three is less than 120 of the keys in table two (or
whatever the actual tables are. Try sorting your finished
table after creating it to see if the record goes where it
belongs.

Alternatively, you could create a series of append queries
to combine all of your tables into one.

Hope I'm not too far off...
 
Ernie,

Thank you for your solution. However, I am sorry to tell
you that the total number of tables I will have in the
furture is about 300. It is very hard to do complete the
task manually. So I tried to do it with code. But got the
mixed table.

One thing that I cancern is, in the mixed core table, I
worried about whether all the records in the small tables
were copied to the core table. I don't know how to check
with it since there were about 10,000 records in the core
table.

Anyway, thank you for your reply.

RC
 
Back
Top