
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_LogError;
EXECUTE usp_PrintError;
END CATCH;

select * from errorlog


