Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trigger problem

Status
Not open for further replies.

Sylvor

IS-IT--Management
Oct 17, 2001
42
0
0
US
Hi anyone :)

I have something interesting (annoying) going on with my trigger on SQL2K, I've noticed several threads on this in the past, but no resolution for the posters.

I have a simple insert statement which puts a few fields into a table on a linked server.

Code:
INSERT OPENQUERY(DBODBC, 'SELECT * FROM STOCK') values ('StockCode', 111, 'Reference')
This code works fine from SQL query analyzer but fails when run as a trigger.
Code:
CREATE TRIGGER HN_TRAN_STKMOVE
ON STK_MOVEMENTS
AFTER INSERT AS
INSERT OPENQUERY(DBODBC, 'SELECT * FROM STOCK') values ('StockCode', 111, 'Reference')

The error I get is "The operation could not be performed because the OLE DB provider 'MSDASQL' was unable to begin a distributed transaction"

Anybody got any ideas?
Thanks as always!
David

Dave Bennett
 
Hiya DB,

Thanks for the link, I already have the reg key that the final poster suggests, although to be honest I have no idea of the relevence of that key.

I also have the DTC service running as I should have, I simply cannot understand the difference between running the query in QA and running it via the trigger.

I am searching the net / other forums / awaiting a response from support (on the other db) but can't find anything positive yet :(

Thanks for replying though - if you have any other ideas let me know!

Many thanks,
David

Dave Bennett
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top