> I'd like to copy some data from one table to another.
>
> The tables are in separate datasources.
>
> If they were in the same DSN, I'd do:
>
> INSERT INTO TABLEB (
>       SELECT * FROM TABLE A WHERE COLUMN = 'CONDITION'
> )
>
> Since they're in separate DSN's, is there any way I can do this without
> doing one query, and looping over it with an insert?

Not directly via SQL

Since it's trying to copy from one datasource to another, it doesn't know
what the sources are, so unless YOU know they're the same, then you'll have
to do it via a CFLoop

If you know they're the same DSN type (i.e. SQL Server), then there are
tricks to get around this;

insert into tableB (field1, field2)
select Field1, Field2
from ServerName.DatabaseName.dbo.TableName
where Field3='Condition'

Or you can wait for CF5 and Query a Query...

Philip Arnold
Director
Certified ColdFusion Developer
ASP Multimedia Limited
T: +44 (0)20 8680 1133

"Websites for the real world"

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to