one word to your code :

Quote:


IF @ERROR NOT = 0





syntactically isn't correct as NOT isn't a conditional operator but a logical one and will cause the script to die on an unhealable "error in expression" in the case @error is anything else than 0 (At least that's I think it will do)

This one would fit better:

Code:

if @error <> 0



or even

Code:

if @error



as this will evaluate a true condition if @error is anything else than 0
_________________________