Hello,
I would like to know how you manage errors what concerns effectivity (reading of code and good code writing). I use thes pattern:
create procedure ...
as
declare
@error int,
@status int
select .... from .....
select @error = @@error
if @error != 0 goto ERROR
update ... from ...
select @error = @@error
if @error != 0 goto ERROR
exec @status = stored_proc
select @error = @@error
if @error != 0 or @status != 0 goto ERROR
OK:
return 0
ERROR:
if @error != 0 return @error
if @status != 0 return @status
Is it good template for errors? Did you solve this any other way? Can there be more effective management of errors e.g. shorter catch... not every statement need to be managed... or on the other hand I should manage simple selects as well. Thanks for your points of view...