SQL Server 2008 links to ORACLE 11

Source: Internet
Author: User

MSSQL2008R2 Link ORACLE 11:

To create a link:


exec sp_addlinkedserver ' dblink_oracl ', ' ORACLE ', ' msdaora ', ' ORCL120 '


Where ORACL120 is the local installation of the Oracle driver, after Tnsnames.ora configured the link string operation, and to be tested with a sqlgate similar tool passed.


ORACLE driver, you can install the thin installation package on the Web, I am a 32-bit system.


exec sp_addlinkedsrvlogin ' Dblink_oracl ', ' false ', NULL, ' user ', ' Userps '


Perform:
SELECT * FROM OPENQUERY (dblink_oracl, ' select Sysdate from dual ');


SELECT * FROM OPENQUERY (dblink_oracl, ' select Manufactureno from User.sample '); note the picture format do not expect Oracle to automatically convert to MSSQL


Insert:

ORACLE fetch, inserted into SQL Server:

Insert into Dhm40 (DHPSDM, DHPSSM)

SELECT * FROM OPENQUERY (Dblink_oracl, ' SELECT DISTINCT TRIM (BC. Color_code), TRIM (BC. color_cname) from brandcolor BC WHERE BC. Bran_code like '%1% ') ' to be fulfilled '.


To delete a link:
Exec sp_droplinkedsrvlogin Dblink_oracl,null
EXEC sp_dropserver Dblink_oracl

SQL Server 2008 links to ORACLE 11

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.