--Author: CXG
--Todo: 远程数据传输(数据库链接)
---------------------------------------------------------------------------------------------------
--add remote server link
--star msdtc first
execute sp_addlinkedserver @server = '192.168.0.45'
execute sp_addlinkedsrvlogin @rmtsrvname = '192.168.0.45',
@useself = false ,
@locallogin = 'sa',
@rmtuser = 'sa' ,
@rmtpassword = null
go
---------------------------------------------------------------------------------------------------
insert into [192.168.0.45].pos_bak.dbo.unit select * from pos_yn.dbo.unit
go
---------------------------------------------------------------------------------------------------
--drop remote server link
execute sp_droplinkedsrvlogin @rmtsrvname = '192.168.0.45', @locallogin = 'sa'
execute sp_dropserver @server = '192.168.0.45'
go
转载于:https://www.cnblogs.com/hnxxcxg/archive/2008/08/02/2941022.html