Help to Capture SP error without try catch block
Hi there, I have 100s of SPs to make change at one shot without touching existing logic. Many SPs have try catch block many dont have. im looking to track if sp ran successful or had failed (if possible why it failed). As you could see im tracking start and end time. Would be helpful if i could track status and errors. add same line of code to all sps without dependency on try catch block. Thanks ALTER PROCedure [Audit].[sptemplate]as begin–Assign Execution idDECLARE @UID UNIQUEIDENTIFIER = NEWID() –Capture StartTimedeclare @starttime datetime = getdate() /*insert into anothertableselect from table business logic */ –Capture StartTimedeclare @endtime datetime = getdate() –Write to LogTableinsert into [Audit].[ETLRunTimeLog] ([LogID],[ProcessName],[StartTime],[EndTime])select @UID u,(SELECT OBJECT_NAME(@@PROCID) ), @starttime s, @endtime e end Read More