--配置SQLSERVER數(shù)據(jù)庫的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數(shù)據(jù)庫的DBLINK
exec sp_addlinkedserver @server = 'mysqltest', @srvproduct='mysql',@provider = 'msdasql', @datasrc = 'MY_TOMATO'
exec sp_addlinkedsrvlogin @rmtsrvname='mysqltest',@useself=false,@locallogin='本地數(shù)據(jù)庫的登陸用戶',@rmtuser='MYSQL的用戶名稱',@rmtpassword='MYSQL的用戶密碼'
select * from openquery(mysqltest,'select * from marketing_data')
--這里的 MY_TOMATO是在WINDSOWS系統(tǒng)管理臺中進行配置的ODBC,在SYSTEM DNS里增加的!