onedunpark
IS-IT--Management
Hi,
Trying to build error-trapping into my triggers.
All of this is being done in Query Analyzer, prior to actually amending the triggers.
These commands work, evaluating the error variable correctly as 0 and displaying 'succeeded' as required.
DECLARE @IERROR INT
INSERT INTO ERRORTABLE (INDEXVAL,TABLENAME) VALUES (1, 'STEVEN')
SELECT @ierror = @@ERROR
IF @ierror <> 0
print 'failed'
ELSE
PRINT 'succeeded'
However, when deliberately removing the second value in the 'values' clause, (to ensure that the error-trap does detect the error), I do get a system message that the columns/values mismatch (as I would expect) but the code does not continue to the error evaluation.
This is no doubt elementary, but I can't suss what to do to have my code continue after the error to actually try and trap it.
Many thanks for any and all replies
Steven
Trying to build error-trapping into my triggers.
All of this is being done in Query Analyzer, prior to actually amending the triggers.
These commands work, evaluating the error variable correctly as 0 and displaying 'succeeded' as required.
DECLARE @IERROR INT
INSERT INTO ERRORTABLE (INDEXVAL,TABLENAME) VALUES (1, 'STEVEN')
SELECT @ierror = @@ERROR
IF @ierror <> 0
print 'failed'
ELSE
PRINT 'succeeded'
However, when deliberately removing the second value in the 'values' clause, (to ensure that the error-trap does detect the error), I do get a system message that the columns/values mismatch (as I would expect) but the code does not continue to the error evaluation.
This is no doubt elementary, but I can't suss what to do to have my code continue after the error to actually try and trap it.
Many thanks for any and all replies
Steven