I think Ajas was referring to the database names (assuming that each DSN was
related to a different database) and if you are using SQL server, you should
be able
to write an insert query from from database to the other. I know this would
work in Enterprise manager but since DSN's are specific to a database, it
may or may not work in this situation. You would definitely need to ensure
that the SQL login that the DSN is using would need access to both databases
(like the sa login). So this may or may not work:
 
<cfquery name="PSAD" datasource="DS1"> 

Select * into [databasename].[ownershipname].[tablename] FROM
[databasename].[ownershipname].tablename]

</cfquery>

 

Assuming the DS1 is using and SQL login that has access to both databases.
This might work. I don't really have the time to try it but someone else
might ...

 

Dusty


  _____  

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tepfer, Seth
Sent: Friday, July 13, 2007 10:35 AM
To: [email protected]
Subject: RE: [ACFUG Discuss] moving tables across data sources



From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ajas Mohammed

    Here is my assumption for your scenario. Lets say datasource1 is for
database A, and the other datasource2 is for database B. 
If you want to copy a table from datasource1 to datasource2, I would do this
in SQL Server(I dont know what db you are using) 
<cfquery datasource="#dsn#"
select * into B..testdummy
from A..testdummy
</cfquery>
I havent done this in CF, but I do this a lot in Query Analyzer. Helps me
create a table with same definition/structure in another database. If you
dont want to import data, then you can add a where clause like this 



Okay, let me confirm I understand.

      <cfquery name="PSAD" datasource="DS1">

            Select * FROM table1

      </cfquery>

 

      <cfquery name="PSA2" datasource="DS2">

            Select * FROM table2

      </cfquery>

 

PSAD.RecordCount = 10,032

PSA2.RecordCount = 0

Column Names are the same.

You are saying I can do .

      <cfquery name="PSA2" datasource="DS2">

            Select * into ds2..table2 FROM ds1..table1

      </cfquery>

 

Hmmm. Gave me an error.


------------------------------------------------------------- 
Annual Sponsor - Figleaf Software <http://www.figleaf.com>  

To unsubscribe from this list, manage your profile @ 
http://www.acfug.org?fa=login.edituserform 

For more info, see http://www.acfug.org/mailinglists 
Archive @ http://www.mail-archive.com/discussion%40acfug.org/ 
List hosted by FusionLink <http://www.fusionlink.com>  
------------------------------------------------------------- 



-------------------------------------------------------------
Annual Sponsor FigLeaf Software - http://www.figleaf.com

To unsubscribe from this list, manage your profile @ 
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------

Reply via email to