RE: SQL Profiler: Attention Event class on DELETE statement - why?



Hi Jeff,

>> What our DB Admins would like to know is why is the return code coming
back
>> as SQL_SUCCESS, when all the triggers haven't even completed.

Since your SQLExecDirect is executing DELETE statement, when DELETE was
done, SQL_SUCCESS will be returned. Trigger was only launched internal SQL
Server and you cannot decide whether trigger was done or not.

I recheck the original post. For your scenario(using trigger to do the
update), you will have to redesign the business logic to avoid the update's
roll back.

For example, create a stored procedure, let the stored procedure to the
DELETE, AUDIT and UPDATE in a transcation. Let you program call the stored
procedure

Thank you for your patience and cooperation. If you have any questions or
concerns, don't hesitate to let me know. We are always here to be of
assistance!


Sincerely yours,

Michael Cheng
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

.



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)
  • 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)
  • RE: How do I schedule transactions in SQL Server?
    ... The database will consist of a Master table of the payments ... Service which will call a stored procedure in SQL (which ... the trigger will kick in when ever the master table above is modified (or a ... > Database Administrator ...
    (microsoft.public.sqlserver.server)

Loading