2

I have created a C# project using MS Access Database and I want to copy data from one table in to another.Is there a simple way to copy all records from one table to another?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Ghadir
  • 47
  • 1
  • 7

2 Answers2

3

If the columns are in the right order, you can do

insert into table2
select * from table1

If the order of the columns are different between the two tables, you can do

insert into table2 (column1, column2, column3)
select column1, column2, column3 from table1
Guilherme
  • 5,143
  • 5
  • 39
  • 60
1

How does this sound?

INSERT INTO Table2( Field1, Field2, FieldN )
SELECT Field1, Field2, FieldN
FROM Table1;
Dextere
  • 281
  • 1
  • 3
  • 13