I have a manager that is asking us to put the following code after each statement in our stored procs(DB is Sybase);
IF @@error != 0
begin
select @returnCd = 250xx
RAISERROR @returnCd "Error xxx "
return -1
END
The question is, is this needed for everything? id think if there was some kind of error doing a select/insert/delete an error would get thrown without me checking the error code. Shouldnt RaiseError be used for capturing errors we know not to be true? like getting no results where results are expected? Is this a common practice?
Thanks