i have a cursor with an if/else statement inside it. at the end of each if, or else i have a line:
if(@@ERROR <>0)
GOTO ErrorHandeler
the ErrorHandeler function is outside just before the last End statement of the sproc. the prob is when the cursor finishes, and the program flow comes outside the cursor this method gets called. how do i prevent this??
ErrorHandler:
BEGIN
DECLARE @ErrFormatStr varchar(255)
RAISERROR (@ErrFormatStr, 1, -1, 'copyPermissionsError', 100001,0)
RETURN -200
END
END --last end statement