MSSQL2008R2 链接 ORACLE 11:
当中ORACL120 为本地安装了ORACLE 驱动程序,在tnsnames.ora配置好链接字符串后的操作,且要用sqlgate类似工具測试通过过.
exec sp_addlinkedsrvlogin 'DBLINK_ORACL' , 'false' , null , 'user' , 'userps'
运行:
select * from openquery(DBLINK_ORACL,'select sysdate from dual');
select * from openquery(DBLINK_ORACL,'select MANUFACTURENO from user.sample');注意图片格式不要指望ORACLE能自己主动转换成MSSQL
创建链接:
当中ORACL120 为本地安装了ORACLE 驱动程序,在tnsnames.ora配置好链接字符串后的操作,且要用sqlgate类似工具測试通过过.
ORACLE 驱动程序,能够安装网上的精简安装包,我是32位系统。
exec sp_addlinkedsrvlogin 'DBLINK_ORACL' , 'false' , null , 'user' , 'userps'
运行:
select * from openquery(DBLINK_ORACL,'select sysdate from dual');
select * from openquery(DBLINK_ORACL,'select MANUFACTURENO from user.sample');注意图片格式不要指望ORACLE能自己主动转换成MSSQL
插入:
ORACLE 取数。插入SQLSERVER中:
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%'' ') '要用''来实现。
删除链接:
Exec sp_droplinkedsrvlogin DBLINK_ORACL,Null
EXEC sp_dropserver DBLINK_ORACL