That code block can be cateogrized as 'horrifying' as it would indicate a lack of understanding of the IF-ELSE-ENDIF construct and functionality. The additional check for @ERROR=0 in the ELSE is superfluous as the only way to actually reach that area is if if 0 to begin with. Thus, the additional check adds absolutely no value. However, if one wants to write absolutely error-free code, then a SELECT-CASE-ENDSELECT would be more appropriate
Code:
SELECT
CASE @ERROR=0
; error is zero
CASE @ERROR<>0
; error is a non-zero value
CASE 1
; error is undefined or otherwise not matching properly
; this should never happen and would be an indicator of a rather catastrophic event
ENDSELECT



Edited by Sealeopard (2007-01-14 04:25 AM)
_________________________
There are two types of vessels, submarines and targets.