Re: try catch ok, what about finally?

Tech-Archive recommends: Speed Up your PC by fixing your registry



And it doesn't. I can get it to work in the sample that you provided
but not in my trigger. The trigger that I'm working with is one large
if/else statement inside of a try/catch. I do have some exec statements
(i.e. exec sp_executesql @query, N'@exists int OUTPUT', @exists =
@pathExists OUTPUT) inside of the try block, I wonder if that's causing
the issue?

When I trigger the trigger I'm getting the message: 'The current
transaction cannot be committed and cannot support operations that
write to the log file. Roll back the transaction.' I'm trying to do an
update inside of the catch block so that I can write the error message
to the table that I'm trying to update (it has a field for the result
of an operation). So I guess I'm gonna back pedal to the version that I
had before.

JCollum wrote:
Mike:

You're right, that worked. Thanks. I'll try this in my full blown sql
and see if it works.

.



Relevant Pages

  • Re: NEED TO CALL AS400 S.P
    ... That is to use a trigger on a table and perform an INSERT/UPDATE which will execute the trigger. ... What an error message! ... > what your OLE DB provider is feed the AS400 with? ... > Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se ...
    (microsoft.public.data.oledb)
  • Re: using a trigger to enforce referential integrity
    ... The first thing to do is COMPLETELY and EXACTLY specify the error message ... Lets avoid "something like..." ... you can then move on to rewriting your trigger to ... FROM tblItemRelationship AS IR ...
    (microsoft.public.sqlserver.programming)
  • Re: Write conflict error after adding trigger to table
    ... This error message is usually the result of a missing primary key or a ... VIEW_METADATA and create an appropriate InsteadOf trigger to have this view ... > view in that database. ... > of using the stored proc as a datasource. ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Killed by Triggers
    ... When I removed the trigger the error disappeared. ... The second situation is when a detail record was attempted, after the header ... If you don't get an error message, ... UPDATE TABLE01 SET CREATEDBY = CURRENT_USER, ...
    (microsoft.public.sqlserver.security)
  • Re: No trigger exception message
    ... >> Sylvain Lafontaine, ing. ... >>> trigger. ... >>> not show the error message of the trigger, the user has no idea what the ...
    (microsoft.public.access.adp.sqlserver)