-- To view the current link situation: Select * from sys.servers; --
Reference:https://msdn.microsoft.com/zh-cn/library/ms190479.aspx
EXECsp_addlinkedserver@server=N'CEM1',@srvproduct=N"',@provider=N'SQLOLEDB',@datasrc=N'192.168.35.6'--Add user login link, parameters: The server alias being accessed, whether to connect by impersonating a local login or explicitly submitting a login name and password, whether to log on locally, login user name, login password
Reference:Https://msdn.microsoft.com/zh-cn/library/ms189811.aspx
EXECsp_addlinkedsrvlogin'CEM1','false',NULL,'SA','Server'
--use Sp_helpserver to display the available linked servers
Execsp_helpserver
--Delete a link that already exists, parameter: Server alias, SQL Server login on the local server. If you want to delete a link, first remove the login map
Reference:https://msdn.microsoft.com/zh-cn/library/ms186218 (v=sql.120). aspx
Exec ' CEM1 ',NULL
Exec ' CEM1 '
-- application: Link alias. database name. Table name
SELECT * from CEM1. [Test2.1]
SQL Server 2008 LAN cross-Servers T-SQL operations (i)