Select in SQL server-cross Instance in same domain and different domain

Source: Internet
Author: User

Same Domain:

Exec sp_addlinkedserver ' PC087 ': Add Remote Server

Exec sp_dropserver ' instcancename ':D elete Remote Server

Sp_helpserver check already registed server at current

Example of function of stored procedure name/view name
sp_addlinkedserver registering a remote DB instance exec sp_addlinkedserver ' instancename '
sp_dropserver Deleting a remote DB instance exec sp_dropserver ' instancename '
sp_addlinkedsrvlogin registered Remote Instance login access account exec sp_addlinkedsrvlogin ' instancename ', NULL
Sp_droplinkedsrvlogin Delete Remote instance login access account EXEC sp_droplinkedsrvlogin ' instancename ', ' UserName '
Sp_helpserver an accessible instance of the current instance that is registered (that is, viewing an instance that has been registered with sp_addlinkedserver) sp_helpserver
sys.sysservers function with Sp_helpserver select * from Sys.sysservers
Sys.linked_logins viewing registered login access accounts (that is, viewing accounts registered with sp_addlinkedsrvlogin) SELECT * FROM Sys.linked_logins
Sys.remote_logins view registered Remote access account SELECT * from Sys.remote_logins

Different Domain:

Use [Tracks]

UPDATE [Tracks]. [dbo]. Shipment SET [Tracks]. [dbo]. Shipment.ispublic=tdss. [IsPublic]

From

(SELECT * from OpenDataSource (' SQLOLEDB ', ' Data source=ip Address; User Id=sa; Password=password '). [Loadtestmanagerui]. [dbo]. [Tripdetailforshipmentsearch])

As Tdss

INNER join [Tracks]. [dbo]. Shipment s on Tdss. Shipmentid=s.shipmentid

Select in SQL server-cross Instance in same domain and different domain

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.