RE: INSERT in linked server by trigger

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: John Bell (JohnBell_at_discussions.microsoft.com)
Date: 09/15/04


Date: Wed, 15 Sep 2004 11:33:05 -0700

Hi

This maybe sounds like a permission thing! Was the trigger action carried
out by QA or another system? Did you explicitly call BEGIN DISTRIBUTED
TRANSACTION before executing the triggering statement?

There are loads of causes for 7391 errors as you probably know!

http://search.microsoft.com/search/results.aspx?qu=7391&View=msdn&st=b&c=0&s=1&swc=0

John

"stoal" wrote:

> Hi all,
>
> I want a trigger to insert a record in a table on a linked server. Tried
> from Query Analyzer and got an 7343-error(cursor operation conflict). The
> strange thing is that SELECT, UPDATE and even DELETE does work?! Now, I fixed
> this by making a stored procedure on the remote db that does the INSERT.
>
> But now the real problem is that I can't call this stored procedure from a
> trigger.
> Calling the stored procedure from Query Analyzer works fine but when I put
> the call in a trigger I get a 7391-error.
>
> I tried defining the linked server in two different ways: sp_addlinkedserver
> and through Enterprise Manager -> both times the same result.
>
> The MSDTC is running in both servers.
>
> Anyone any idea?



Relevant Pages

  • Re: chooses not to generate code at all
    ... >>>DBMS is so that the DBMS engine can execute it when triggered by some ... If there is no trigger, ... Stored procedure is one thing. ... > If the procedure execution is not triggered by DBMS ...
    (comp.object)
  • Re: Insert Error 30014
    ... of @@identity before the stored procedure finish: ... the trigger. ... I have a form where I want to have underlying record source of a single ... EventId ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Insert Error 30014
    ... of @@identity before the stored procedure finish: ... the trigger. ... >> I have a form where I want to have underlying record source of a>> single ... >> EventId ...
    (microsoft.public.access.adp.sqlserver)
  • INSERT in linked server by trigger
    ... I want a trigger to insert a record in a table on a linked server. ... this by making a stored procedure on the remote db that does the INSERT. ... Calling the stored procedure from Query Analyzer works fine but when I put ...
    (microsoft.public.sqlserver.programming)
  • Re: Question on Triggers
    ... If the trigger fires, it can either execute code directly or it can execute a stored procedure. ... Cross database does have security issues, but Erland Sommarskog's article discusses all the ways that you can get this to work, with the pros and cons of each. ...
    (microsoft.public.sqlserver.programming)