April 7, 2010 at 3:02 am
I want to check the trigger in place, it's where I want to continue processing even if errors, such as procedure.I dont know how do this
April 7, 2010 at 5:30 am
April 7, 2010 at 6:39 am
thanks a lot:))
April 7, 2010 at 6:42 am
No worries. Don't forget to check XACT_STATE in the CATCH block 🙂
April 7, 2010 at 6:47 am
ok:)
April 8, 2010 at 2:25 am
I want to update a table.even if A error occur in trigger,I want to update process complete.but when the error fall begin catch block, update dont complete.how I do this?
April 8, 2010 at 2:34 am
ALTER TRIGGER [dbo].[example]
ON [dbo].[exampleTable]
AFTER Update
AS
BEGIN
BEGIN TRY
SELECT 1/0
END TRY
BEGIN CATCH
END CATCH
END
trigger have error here,you dont update,I want trigger skip error,update run.
April 8, 2010 at 3:20 am
SQL Server's response to an error depends on the error, and session settings.
Overflow and divide-by-zero errors are affected by the following session settings:
In this case, your session settings are such that the divide-by-zero error aborts the trigger transaction. Because the transaction is aborted immediately, TRY...CATCH can only handle the error - it cannot restart the already-aborted transaction.
Viewing 8 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply