sqlserver轉資料到oracle

來源:互聯網
上載者:User
/*--------------------建立oracle連結的伺服器 --------------------*/EXEC sp_addlinkedserver   @server = 'ORCL',  --ORCL是SQL中連結的伺服器名稱   @srvproduct = 'Oracle',  --Oracle 固定的   @provider = 'MSDAORA',  --MSDAORA 固定的    @datasrc = 'ORCL'   --DataSrc 本地服務名 GOEXEC SP_ADDLINKEDSRVLOGIN 'ORCL', false, 'sa', 'SCOTT', 'admin' --Sa是SQL本地登入帳號,POS/POS是ORACLE的登入帳號,但這句話對我們要達到的目的沒有協助。 --測試SELECT * FROM ORCL..SCOTT.EMP   --注意大寫/*---------------------建立sqlserver連結的伺服器------------------------------------*/EXEC master.dbo.sp_addlinkedserver @server = N'192.168.0.170', @srvproduct=N'SQL Server'GOexec   sp_addlinkedsrvlogin   '192.168.0.170','false','sa','sa','123465'goSELECT * FROM [192.168.0.170].pubs.dbo.authors--可以通過dts把表結構建好在目標oracle上/*------------------------匯入資料------------------------------------------------------*/SELECT * FROM ORCL..SCOTT.zx_nrinsert ORCL..SCOTT.authors select * from authors insert ORCL..SCOTT.employee select * from employee insert ORCL..SCOTT.jobs select * from jobs insert ORCL..SCOTT.stores select * from stores insert ORCL..SCOTT.sales select  * from [192.168.0.170].pubs.dbo.salesinsert ORCL..SCOTT.zx_xx select top 100 wj 
from [192.168.0.170].vsatdata.dbo.zx_xx where lx='2'insert ORCL..SCOTT.zx_nr select top 10 * from [192.168.0.170].vsatdata.dbo.zx_nr
 where wj in (select top 100 wj from [192.168.0.170].vsatdata.dbo.zx_xx where lx='2')select top 10 * from [192.168.0.170].vsatdata.dbo.zx_gp_nr
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.