![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
-- I made the following local procedure: create procedure proc_AccountTransfer @client varchar(50) = null ,@account varchar(50) = null ,@amount money = null as set nocount on set ansi_warnings on set xact_abort on begin distributed transaction exec proc_AccountFrom 'Bishoy','Saving',1000 exec server01.Northwind.dbo.proc_AccountTo 'Bishoy','Saving',1000 commit transaction go -- I also made local procedure: create procedure proc_AccountFrom @client varchar(50) = null ,@account varchar(50) = null ,@amount money = null as set nocount on update client03.Northwind.dbo.ClientAccount set AccountAmount = AccountAmount - @amount where ClientName = @client and AccountName = @account go -- I also made a procedure on the server: create procedure proc_AccountTo @client varchar(50) = null ,@account varchar(50) = null ,@amount money = null as set nocount on update server01.Northwind.dbo.ClientAccount set AccountAmount = AccountAmount + @amount where ClientName = @client and AccountName = @account set nocount off -- The table code: use northwind go CREATE TABLE [dbo].[ClientAccount] (ClientID int IDENTITY (1,1) NOT NULL ,ClientName varchar (50) NOT NULL ,AccountName varchar (50) NOT NULL ,AccountAmount money NOT NULL ,constraint PK_ClientID primary key clustered (ClientID) ,constraint CK_Amount check (AccountAmount >= 0) ) go insert into dbo.ClientAccount values ('Bishoy','Checking',100000) insert into dbo.ClientAccount values ('Bishoy','Saving',2000) go -- But I received the following response: Server: Msg 7391, Level 16, State 1, Procedure proc_AccountTransfer, Line 12 The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction. [OLE/DB provider returned message: New transaction cannot enlist in the specified transaction coordinator. ] OLE DB error trace [OLE/DB Provider 'SQLOLEDB' ITransactionJoin::JoinTransacti on returned 0x8004d00a]. -- Although: The DTS was active on both servers --- and they was linked --- and the tables present -- Thank you. Bishoy |
![]() |
| Thread Tools | |
| Display Modes | |
| |