I meant using the database name (i.e. A or B) prefix and not the datasource
name. There is no way for SQL Server or any database to know the name of
your CF datasource.

Here is what I had said  " Lets say datasource1 is for database A, and the
other datasource2 is for database B. " If you look at the query I sent :
<cfquery datasource="#dsn#"
select * into B..testdummy
from A..testdummy
</cfquery>

So your query should be

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

           *Select* * into nameofDataBase2..table2 *FROM* nameofDataBase1
..table1

</cfquery>

Ajas.


On 7/13/07, Tepfer, Seth <[EMAIL PROTECTED]> wrote:

 *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>
-------------------------------------------------------------




--
<Ajas Mohammed />
http://ajashadi.blogspot.com
No matter what, find a way. Because thats what winners do.
You can't improve what you don't measure.



-------------------------------------------------------------

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