-
1) For MSDTC exceptions, the general solution is as follows,
-
First, make sure that the DTC is available in Control Panel-add or delete programs-Add/delete Windows Components-application server.
-
Step 1: for the two servers in different domains, update C: "Windows" System32 "drivers" etc "hosts and add the IP address of the other server, computer name.
-
-
Step 2: Click the menu to go to the running options and enter 'dcomcnfg'. The following interface is displayed.
-
-
-
Step 3: select the red area.
-
-
-
Step 4: Perform Security Configuration
-
Step 5: Click OK. The system automatically restarts services such as MSDTC and SQL Server.
Ii) records set of remote SP calls by SQL, without MSDTC
Bytes --------------------------------------------------------------------------------------------------------
--- Prerequisites: Create a linked server
Exec sp_addmediaserver 'srv _ lnk ', '', 'sqlodb', 'remote server name or IP address'
Exec sp_add1_srvlogin 'srv _ lnk ', 'false', null, 'username', 'Password'
Exec sp_serveroption 'srv _ lnk ', 'rpc out', 'true' -- this allows you to call stored procedures on the linked server.
Bytes --------------------------------------------------------------------------------------------------------
--- Method 1
------ Truncate/create/Insert table at remote server
Declare @ iSQL nvarchar (300)
If exists (select * from [172.26.16.4]. smtother. DBO. sysobjects where name = n' _ tempcheckresult' and type = n' U ')
Begin
Set @ iSQL = n' truncate table _ tempcheckresult'
Exec [172.26.16.4]. smtother. DBO. sp_executesql @ iSQL
End
Else
Begin
Set @ iSQL = n' create table _ tempcheckresult (iresult varchar (50 ))'
Exec [172.26.16.4]. smtother. DBO. sp_executesql @ iSQL
End
Set @ iSQL = n' insert into _ tempcheckresult exec [copypackingsnform2checkbysn] '+ ''' + 'w88410320.5vsa' + ''''
Exec [172.26.16.4]. smtother. DBO. sp_executesql @ iSQL
Select * from [172.26.16.4]. smtother. DBO. _ tempcheckresult
Bytes ---------------------------------------------------------------------------------------------------------------
--- Method 2
------ Truncate/create/Insert table at remote server for sql2005
Declare @ iSQL nvarchar (300)
If exists (select * from [172.26.16.4]. smtother. DBO. sysobjects where name = '_ tempcheckresult' and type = n' U ')
Begin
Set @ iSQL = n' truncate table smtother. DBO. _ tempcheckresult'
Execute (@ iSQL) at [172.26.16.4]
End
Else
Begin
Set @ iSQL = n' create table smtother. DBO. _ tempcheckresult (iresult varchar (50 ))'
Execute (@ iSQL) at [172.26.16.4]
End
Set @ iSQL = n' insert into smtother. DBO. _ tempcheckresult exec smtother. DBO. [copypackingsnform2checkbysn] '+ ''' + 'w8841031_5vsa' + ''''
Execute (@ iSQL) at [172.26.16.4]
Select * from [172.26.16.4]. smtother. DBO. _ tempcheckresult