
CREATE PROCEDURE errorproc1
AS
BEGIN TRY
  BEGIN TRANSACTION;
    -- UPDATE ....
    -- INSERT ....
    DELETE jobs WHERE job_id = 3;
  COMMIT TRANSACTION;
END TRY
BEGIN CATCH 
-- more code goes here
IF XACT_STATE() <> 0
  ROLLBACK TRANSACTION;

EXECUTE usp_RethrowError;
-- EXECUTE usp_PrintError;
END CATCH;
go

CREATE PROCEDURE errorproc2
AS
    -- UPDATE ....
    -- INSERT ....
    DELETE jobs WHERE job_id = 3;
go
