Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Distributed Transaction Error

Author  Topic 

yakoo
Constraint Violating Yak Guru

312 Posts

Posted - 2001-11-09 : 09:49:47
I'm trying to update a field in one table with the SUM of a field from two seperate tables.

Can anyone point out what I'm doing wrong in this code?

UPDATE c SET c.Cost =tc.TotalCost FROM Costs c
INNER JOIN (Select t.CostID, SUM(t.Cost) as TotalCost FROM
(SELECT CostID, Cost FROM costsTable_1.dbo.Costs
UNION ALL
SELECT CostID, Cost FROM costsTable_2.dbo.Costs) t
GROUP BY t.CostID) tc
ON (c.CostID = tc.CostID)


the error I recieve is in QA is: "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. ]"

   

- Advertisement -