- 论坛徽章:
- 0
|
--设informix上有数据库databasename,有表tbl_test,只有一列name,sqlserver服务器上有informix ole db 3.0 驱动,存在odbc配置odbc_srv数据源连到informix数据库databasename上。
EXEC sys.sp_addlinkedserver
@server = 'link_srv',
@srvproduct = '',
@provider = 'MSDASQL',
@datasrc = 'odbc_srv'
GO
EXEC sp_addlinkedsrvlogin 'link_srv','false',NULL,'informix','informixpwd'
GO
SELECT * FROM OPENQUERY(link_srv,'SELECT * FROM tbl_test');
DELETE FROM OPENQUERY(link_srv,'SELECT * FROM tbl_test');
UPDATE link_srv.databasename.informix.tbl_lict SET name='adsf';
INSERT INTO OPENQUERY(link_srv,'SELECT * FROM tbl_test Where 1<>1') SELECT('试试'); |
|