Problem : Connecting to a Oracle DB using MS SQL Opendatasource

Problem : Connecting to a Oracle DB using MS SQL Opendatasource

I am wanting to dump some data from a Oracle DB into a SQL temp table to use in other MS SQL queries. Can this be done?


Solution : Connecting to a Oracle DB using MS SQL Opendatasource

yes u can do this..

2 ways..
One is adding oracle as a linked server..
example
EXEC sp_addlinkedserver
‘LONDON Mktg’,
‘Oracle’,
‘MSDAORA’,
‘MyServer’

and running ur query like
select * into   #temptable from (select  * from (openquery([London Mktg], ‘select * from my oracle table’)) drv

other way is

select * from
OPENrowset(‘MSDAORA’,’Oracle SID’;’username’;’password’,’my select query’) drv