Hei,
We have 2 MS SQL SERVER 2000 installed on 2 different servers (2 separated
machines).
I am triing to connect them så that when one row is added to the table in
the database in main server - then the same row is added to the same table
in the second server database.
I made the insert trigger on the table in the first server ( the second
server is added as a linked server):
----------------------------------------------------------------------------
-------------
create trigger ti_myTabe1 on myTable1 for insert as
begin
declare ........
BEGIN
insert into server2.myDatabase2.owner.myTable2
(column1, column2, column3)
SELECT column1, column2, column3
FROM inserted ins
END
......
end
----------------------------------------------------------------------------
-------------
When I run the statement in "SQL Query Analyzer"on the first server:
insert into Table1 values(va1,val2,val3)
then error is coming:
Server: Msg 7391, Level 16, State 1, Procedure ti_myTabe1 , Line 19
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::JoinTransaction returned 0x8004d00a].
The straing thing is: if I run the statement in "SQL Query Analyzer"on the
first server:
insert into server2.myDatabase2.owner.myTable2 values(va1,val2,val3)
then it works!
But not inside the trigger!!! - What I am doing wrong ?
Any idea is greatly appeciated.