dbo.QBM_PTransactionLevelCheck
Stored ProcedureSQL_STORED_PROCEDURESandbox DB
Interpretation
- Database routine. Review parameters, called procedures, DBQueue inserts, and QBM_PJobCreate helper calls before assuming side effects.
Relations
- No extracted relations.
Typed Edges
- references source dbo.QBM_FGISessionErrorIsMissingCo source text reference
- references source dbo.QBM_FGISessionErrorRethrow source text reference
- references source dbo.QBM_PJournal source text reference
- references source dbo.QBM_PSessionErrorAdd source text reference
References
- dbo.QBM_FGISessionErrorIsMissingCo
- dbo.QBM_FGISessionErrorRethrow
- dbo.QBM_PJournal
- dbo.QBM_PSessionErrorAdd
Referenced By
- dbo.ATT_PHelperAttestationPolicy
- dbo.QBM_PDBQCS_CurrentRestore
- dbo.QBM_PDBQCS_SlotExec
- dbo.QBM_PDBQCS_SlotFill
- dbo.QBM_PDBQCS_SlotFill_Range
- dbo.QBM_PDBQCS_SlotRunner
- dbo.QBM_PWorkDBQueueDelete
- dbo.QBM_PWorkHistoryDelete
- dbo.QBM_PWorkJobQueueDelete
- dbo.QBM_PWorkMaintenance
- dbo.QBM_PWorkSchedule
- dbo.QBM_ZJobHistoryShrink_Pat
- dbo.QBM_ZProcessShrink_Pat
- dbo.QBM_ZProgressViewShrink_Pat
- dbo.QBM_ZWatchShrink_Pat
Complete Source
1CREATE PROCEDURE QBM_PTransactionLevelCheck(2 @ExpectedLevel int,3 @SourceProcedure int = 0,4 @DebugComment nvarchar(1000) = N ''5)6AS7BEGIN8 DECLARE @Message nvarchar(1000)9 DECLARE @procname nvarchar(256)10 DECLARE @DebugLevel char(1) = 'W'11 SET XACT_ABORT OFF12 BEGIN TRY13 IF @@TRANCOUNT = ISNULL(@ExpectedLevel,14 0)15 BEGIN16 EXEC QBM_PJournal 'Level OK',17 @@PROCID,18 'I',19 @DebugLevel20 GOTO endLabel21 END22 IF @SourceProcedure = 023 BEGIN24 SELECT @Procname = object_name(@@procid)25 END26 ELSE27 BEGIN28 SELECT @Procname = object_name(@SourceProcedure)29 END30 SELECT31 @Message = '#LDS#Expected transaction count {0} does not match existing {1}, called from {2}.|' + str(isnull(@ExpectedLevel,32 0)) + '|' + str(@@TRANCOUNT) + '|' + @Procname + '|'33 IF @DebugComment > ' '34 BEGIN35 SELECT36 @Message = @Message + ', ' + @DebugComment37 END38 SELECT @Message = @Message + ')' ROLLBACK TRANSACTION39 EXEC QBM_PJournal @Message,40 @@PROCID,41 'E',42 @DebugLevel43 RAISERROR(@Message,44 18,45 1)46 WITH nowait47 END TRY48 BEGIN CATCH49 EXEC QBM_PSessionErrorAdd DEFAULT50 IF dbo.QBM_FGIsessionErrorIsMissingCO(DEFAULT) = 051 BEGIN52 ROLLBACK TRANSACTION53 DECLARE @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow()54 RAISERROR(@Rethrow,55 18,56 1)57 WITH NOWAIT58 END59 END CATCH60 endLabel:61 RETURN62END
Open raw exported source
1 create procedure QBM_PTransactionLevelCheck (@ExpectedLevel int , @SourceProcedure int = 0 , @DebugComment nvarchar(1000) = N'' ) as begin declare2 @Message nvarchar(1000) declare @procname nvarchar(256) declare @DebugLevel char(1) = 'W' SET XACT_ABORT OFF BEGIN TRY if @@TRANCOUNT = ISNULL(@ExpectedLevel3, 0) begin exec QBM_PJournal 'Level OK', @@PROCID, 'I', @DebugLevel goto endLabel end if @SourceProcedure = 0 begin select @Procname = object_name(@@procid4) end else begin select @Procname = object_name(@SourceProcedure) end select @Message = '#LDS#Expected transaction count {0} does not match existing {1}, called from {2}.|'5 + str(isnull(@ExpectedLevel, 0)) + '|' + str( @@TRANCOUNT) + '|' + @Procname + '|' if @DebugComment > ' ' begin select @Message = @Message + ', ' + @DebugComment6 end select @Message = @Message + ')' rollback transaction exec QBM_PJournal @Message, @@PROCID, 'E', @DebugLevel raiserror (@Message, 18, 1) with nowait7 END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default if dbo.QBM_FGIsessionErrorIsMissingCO(default)= 0 begin rollback transaction declare @Rethrow varchar8(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT end END CATCH endLabel: return end 9