--配置SQLSERVER数据库的DBLINK
exec sp_addlinkedserver @server='WAS_SMS',@srvproduct='',@provider='SQLOLEDB',@datasrc='10.131.20.100'
exec sp_addlinkedsrvlogin 'WAS_SMS','false', NULL,'CustomSMS','SqlGdn@InfoxMas2008'
select top 100 * from AS400.AS400_Extract.DBO.ORDUNA
--配置SQLSERVER到MYSQL数据库的DBLINK
exec sp_addlinkedserver @server = 'mysqltest', @srvproduct='mysql',@provider = 'msdasql', @datasrc = 'MY_TOMATO'
exec sp_addlinkedsrvlogin @rmtsrvname='mysqltest',@useself=false,@locallogin='本地数据库的登陆用户',@rmtuser='MYSQL的用户名称',@rmtpassword='MYSQL的用户密码'
select * from openquery(mysqltest,'select * from marketing_data')
--这里的 MY_TOMATO是在WINDSOWS系统管理台中进行配置的ODBC,在SYSTEM DNS里增加的!