/*mssql--Create remote link exec sp_addlinkedserver@server= ' pacs_link ',--the server alias being accessed @srvproduct= ',--sqls Erver default does not need to write, or oracle@provider= ' SQLOLEDB ',--different libraries are not the same, the OLE db character @datasrc= ' 59.110.5.215,51800 '--the server to be accessed goexec sp_ Addlinkedsrvlogin @rmtsrvname = ' Pacs_link ',--the server alias being accessed @useself= ' false ',--fixed so write @locallogin= ' sa ',--local operation account name @rmtuser = ' Testpass ',--the server user name @rmtpassword= ' [email protected] '--the server accessed with password go----//delete connection server--exec sp_dropserver "Pacs_ LINK "--select * from Pacs_link. [Newnanningsystemdb]. [dbo]. [V_devicelist]*//*mysql--Establish database link server exec sp_addlinkedserver@server =n ' Lis_link ',--the linked server alias to be created @srvproduct=n ' M Ysql ',--product name @provider=n ' Msdasql ',--ole DB drive name (fixed) @datasrc =n ' MySQL '--data source (requires modification, format IP: Port/service_name) goexec sp_ Addlinkedsrvlogin@rmtsrvname= ' Lis_link ',--Established link server name @useself= ' false ',--fixed * @locallogin = NULL,--For each login SQL Server users use this linked server, write user name * fixed @rmtuser= ' root ',--account (need to modify) @rmtpassword = ' inteall '--password (need to modify) GO----//Delete connection server--EXEC sp_ Dropserver "Lis_link"--select * from OPENQUERY ([Lis_link], ' select * from Lisinterface.temp ')*//*oracle--establishing a database link server exec sp_addlinkedserver@server =n ' His_link ',--the linked server alias to be created @srvproduct=n ' ORACLE ',--product name (fixed) @provider =n ' oraoledb.oracle ',--ole DB driver name (fixed) @datasrc =n ' ORCL1 '--data source (requires modification, format IP: Port/service_name ) goexec sp_addlinkedsrvlogin ' His_link ',--Established link server name ' false ',--fixed * NULL,--write username * PIN for each user logging in to SQL Server Hisdata ',--account (Oracle) (requires modification) ' inteall2012 '--Password (Oracle) (need to be modified) GO----//Delete connection server--EXEC sp_dropserver "His_link"--Select * FROM OPENQUERY ([His_link], ' select * from V_intefacecosedetail ')--select * from OPENQUERY (his_link, ' select * from Temp ')*/
SQL SERVER creates a remote database link