1. Open the MSDTC Service of the local SQL Server
2. Dial the number to the remote server (modem-to-modem)
3. Add a remote server locally:
Exec sp_addmediaserver @ server = '192. 168.2.44'
Exec sp_add1_srvlogin @ rmtsrvname = '192. 168.2.44 ',
@ Useself = false,
@ Locallogin = 'sa ',
@ Rmtuser = 'sa ',
@ Rmtpassword = null
4. directly use SQL statements to transmit data
Select * from [192.168.2.44]. zlsgl. dbo. t_cby update [192.168.2.44]. zlsgl. dbo. t_cby set xm = rtrim (xm) + '1' where bh = 4
5. Close the connection after completion:
Sp_droplinkedsrvlogin @ rmtsrvname = '192. 168.2.44 ', @ locallogin = 'sa'
Sp_dropserver @ server = '2017. 192.
Or use the connection Server:
EXEC sp_addmediaserver
'Alias ',
'',
'Msdasql ',
NULL,
NULL,
'Driver = {SQL Server}; SERVER = remote name; UID = user; PWD = password ;'
GO
Then you can:
Select * from alias. Database Name. dbo. Table Name
Insert database name. dbo. Table Name select * from alias... database name. dbo. Table Name
Select * into database name. dbo. New table name from alias... database name. dbo. Table Name
Go