HowTo Copy a Recordset from a Table to an identically structured table 
Author Message
 HowTo Copy a Recordset from a Table to an identically structured table

Ok.

I have two tables who have exactly the same structure and attributes.
I want to copy the entire contents of one into the other one.
According to previous posts I read, the only way to achieve it is to
copy it record by record, and field by field.  I want to know if there's
a more efficient way to achieve the same goal, using queries, or
some magical function or object I wouldn't know of.

Thanks for any tips or insights

--
L.-Martin Breton, B. Sc. A.
Analyste / Programmeur
~~~~~~~~~~~~~~~~~~~~~~~~~
La Socit conseil LAMBDA inc.
~~~~~~~~~~~~~~~~~~~~~~~~~

Site web: http://www.*-*-*.com/
~~~~~~~~~~~~~~~~~
ICQ UIN: 10128604
~~~~~~~~~~~~~~~~~



Sat, 07 Apr 2001 03:00:00 GMT  
 HowTo Copy a Recordset from a Table to an identically structured table
Hi,
    This should do it:

    INSERT INTO SecondTable SELECT FirstTable.* FROM FirstTable;

Quote:

>Ok.

>I have two tables who have exactly the same structure and attributes.
>I want to copy the entire contents of one into the other one.
>According to previous posts I read, the only way to achieve it is to
>copy it record by record, and field by field.  I want to know if there's
>a more efficient way to achieve the same goal, using queries, or
>some magical function or object I wouldn't know of.

>Thanks for any tips or insights

>--
>L.-Martin Breton, B. Sc. A.
>Analyste / Programmeur
>~~~~~~~~~~~~~~~~~~~~~~~~~
>La Socit conseil LAMBDA inc.
>~~~~~~~~~~~~~~~~~~~~~~~~~

>Site web: http://www.LAMBDA.qc.ca
>~~~~~~~~~~~~~~~~~
>ICQ UIN: 10128604
>~~~~~~~~~~~~~~~~~



Sat, 07 Apr 2001 03:00:00 GMT  
 HowTo Copy a Recordset from a Table to an identically structured table
An append query looks the most efficient way to me. Or, if you want to replace the contents, a delete query and an
append query.


Quote:
> Ok.

> I have two tables who have exactly the same structure and attributes.
> I want to copy the entire contents of one into the other one.
> According to previous posts I read, the only way to achieve it is to
> copy it record by record, and field by field.  I want to know if there's
> a more efficient way to achieve the same goal, using queries, or
> some magical function or object I wouldn't know of.

> Thanks for any tips or insights

> --
> L.-Martin Breton, B. Sc. A.
> Analyste / Programmeur
> ~~~~~~~~~~~~~~~~~~~~~~~~~
> La Socit conseil LAMBDA inc.
> ~~~~~~~~~~~~~~~~~~~~~~~~~

> Site web: http://www.LAMBDA.qc.ca
> ~~~~~~~~~~~~~~~~~
> ICQ UIN: 10128604
> ~~~~~~~~~~~~~~~~~



Sat, 07 Apr 2001 03:00:00 GMT  
 HowTo Copy a Recordset from a Table to an identically structured table
(1) Re SQL copy, MS syntax is SELECT FirstTable.* INTO SecondTable FROM
FirstTable.  Also, you would have to recreate any indexes (CREATE INDEX
indexname on SecondTable(field1, ...) [AS PRIMARY/UNIQUE]).
(2) Look at the TransferDatabase action/method.
HTH, Roger
Quote:

>Hi,
>    This should do it:

>    INSERT INTO SecondTable SELECT FirstTable.* FROM FirstTable;


>>Ok.

>>I have two tables who have exactly the same structure and attributes.
>>I want to copy the entire contents of one into the other one.



Sun, 08 Apr 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Copying the structure of a table to a new table

2. Copying the structure of one Access table to a new Access table

3. Copy/Saving a recordset from one data table to another table

4. copy table structure

5. Copying table structures in code

6. Newbie: How to copy Table structure?

7. Copy Foxpro 2.6 table structure

8. Creating .MDB in ADO; copying a table structure

9. How to copy structure of a table to another database

10. Copying Table structures

11. Newbie: How to copy Table structure?

12. Q. How do I copy a table structure

 

 
Powered by phpBB® Forum Software