The example in this article describes how SQL Server simply creates dblink to operate a remote servers database. Share to everyone for your reference, specific as follows:
--Configure SQL Server database 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 * from AS400. AS400_Extract.DBO.ORDUNA
--dblink exec sp_addlinkedserver, which configures SQL Server to the MySQL database
, @server = ' mysqltest ', @ srvproduct= ' mysql ', @provider = ' msdasql ', @datasrc = ' My_tomato '
exec sp_addlinkedsrvlogin @rmtsrvname = ' Mysqltest ', @useself =false, @locallogin = ' login user for local database ', @rmtuser = ' user name for MySQL ', @rmtpassword = ' mysql user password '
select * From OPENQUERY (mysqltest, ' select * from Marketing_data ')-
-here My_tomato is configured in the Windsows system console in ODBC, Added in DNS!
I hope this article will help you with the database program design.