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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dumping a table from one datasource into another

Status
Not open for further replies.
Feb 20, 2002
64
US
Is there a way to take a table inside one datasource and dump it into a table inside another datasource?
 
just use two CFQUERY's
one to get all the information from datasource one
and then use those values in an Insert to add them to the table in datasource two.
just to make sure everything is done correctly use a CFTRANSACTION around the whole thing...


good luck çB^]\..
 
I thought of this too.

But there are problems with this.

This is my thought process:

1. Do a CFQUERY on DataSource ONE.
2. CFLOOP through DataSource ONE with an Insert CFQUERY on DataSource TWO.

the main issue i have with this process is that you have to first CREATE the table in DataSource TWO and also all of the columns/field-names that are in DataSource ONE to DataSource TWO before you can CFLOOP an insert CFQUERY which will take forever to finish looping if you have 1500+ records to copy.

This i can do....but it doesn't seem efficient. And the coding to create the table first with all the appropriate column/field-names seems like overkill to me. I was wondering if there was a method more efficient than this.

For example, if you wanted to copy one table to another table WITHIN THE *SAME* Datasource, you would use the following query:

SELECT * INTO TABLE_COPY
FROM TABLE_ORIGINAL
[WHERE (criteria) ]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top