SQL Server simple way to create a dblink operation remote server database _mssql

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.