Toad World® Forums

how to select from a table via another connection

How do i create a sql statement that allows me to select data from a table that exist on another connection.

Example i have 3 instances of the same database which contain data at 3 different times.

I have DEVL, PREPROD and PRODUCTION

I am trying to write an SQL statement that pulls data out of a table on the PROD connection and inserts the data into same table on the DEVL connection.

Can this be handled within an sql statement?

Thanks,

Dane

if the DEVL server can make a connection to the PRODUCTION server, then you can create a database link on the DEVL server that points to the PRODUCTION server.

Then you could connect to the DEVL server and do a statement like this:

Create table

as select * from @

If that’s not an option, and the source/target tables already exist, then you can connect with Toad to the production database, find your table in the schema browser, rt-click and choose “Copy to another schema”. That will open a window where you can choose the target table and it will copy the data across.