Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SQL Server DTC URGENT PLEASE....

Posted on 2000-05-10
3
Medium Priority
?
499 Views
Last Modified: 2012-06-27
Hi,
I'm in a situation with two servers (SQL Server 7 ) in the same domain. I configured both servers as linked servers. I also run MSDTC on both servers. I have a trigger on the table in one DB which should update a table in the other DB on the other server. The trigger looks as follows :
CREATE TRIGGER UPDATE_SPECIE ON dbo.tbl_specie
FOR  UPDATE
AS
BEGIN
           UPDATE  vauveil.urk2000.dbo.tbl_species
           SET sp_priority=B.sp_prior, sp_niv1=B.sp_grpcode, sp_niv2=B.sp_code,
                   sp_box_content=B.sp_qubox, sp_min_amount_startprice=B.sp_minkg,
                   sp_tara=B.sp_tara, sp_percent_liquid=B.sp_nat, sp_tolerance=B.sp_tol,
                        sp_shape=B.sp_shape, sp_size=B.sp_size
           FROM vauveil.urk2000.dbo.tbl_species as c, tbl_specie AS B   WHERE c.sp_code=B.sp_code
END

When I try to update the table I receive the following error message :
OLE/DB Provider returmed message : Only one transaction can be active on this session.
Could not start a transaction for oledb provider 'SQLOLEDB'.

I looked at the settings but I don't seem to have any way that I can adjust a setting. What is going wrong? Do I need to specify that it is a distributed transaction. I tried it and replaced the begin by begin distributed transaction and the end by commit transaction but this didn't work either. I need to strat this project up tomorrow so all suggestions are welcome.
0
Comment
Question by:TomDedecker
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 32

Expert Comment

by:Brendt Hess
ID: 2798233
I'd recommend using the logical 'inserted' table:

CREATE TRIGGER UPDATE_SPECIE ON dbo.tbl_specie
FOR  UPDATE
AS
BEGIN
           UPDATE  vauveil.urk2000.dbo.tbl_species
           SET sp_priority=B.sp_prior, sp_niv1=B.sp_grpcode, sp_niv2=B.sp_code,
                  sp_box_content=B.sp_qubox, sp_min_amount_startprice=B.sp_minkg,
                   sp_tara=B.sp_tara, sp_percent_liquid=B.sp_nat, sp_tolerance=B.sp_tol,
                   sp_shape=B.sp_shape, sp_size=B.sp_size
           FROM inserted AS B
   WHERE vauveil.urk2000.dbo.tbl_species.sp_code IN (Select sp_code from inserted)

END

This will only update those that changed, and will not involve the original table at all, thus (hopefully) avoiding the problem with the transaction conflict.
0
 

Author Comment

by:TomDedecker
ID: 2799192
You' re right but this isn't a solution for our problem. Further tests hqve shown that the OLEDB transaction error isn't significant. As a matter a fact even zhen you have a syntax error in a trigger it gives the same error.
0
 

Accepted Solution

by:
bucodi earned 200 total points
ID: 2799577
We have done some tests and found the following solution:
Jo just put a COMMIT at the beginning of your trigger
CREATE TRIGGER UPDATE_SPECIE ON dbo.tbl_specie
FOR  UPDATE
AS
BEGIN
COMMIT
           UPDATE  vauveil.urk2000.dbo.tbl_species
           SET sp_priority=B.sp_prior, sp_niv1=B.sp_grpcode, sp_niv2=B.sp_code,
                  sp_box_content=B.sp_qubox, sp_min_amount_startprice=B.sp_minkg,
                   sp_tara=B.sp_tara, sp_percent_liquid=B.sp_nat, sp_tolerance=B.sp_tol,
                   sp_shape=B.sp_shape, sp_size=B.sp_size
           FROM inserted AS B
   WHERE vauveil.urk2000.dbo.tbl_species.sp_code IN (Select sp_code from inserted)

END
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question