dbo.QBM_PWorkJobQueueDelete

SQL_STORED_PROCEDURE

Created 2025-06-27T17:57:37.287 · modified 2026-04-14T23:16:09.013 · source: live DB sys.objects/sys.sql_expression_dependencies.

Open formatted source/search result

Parameters

NameTypeOutput
No parameters.

Referenced objects

SchemaObjectColumn/minorClass
JobQueueOBJECT_OR_COLUMN
QBM_PDBQueueAgentInfoSetOBJECT_OR_COLUMN
QBM_PJobQueueDeleteOBJECT_OR_COLUMN
QBM_PJobQueueStatsShrinkOBJECT_OR_COLUMN
QBM_PSessionContextSetOBJECT_OR_COLUMN
QBM_PSessionErrorAddOBJECT_OR_COLUMN
QBM_PSessionErrorCleanOBJECT_OR_COLUMN
QBM_PTransactionLevelCheckOBJECT_OR_COLUMN
QBM_PWaitForSecondsOBJECT_OR_COLUMN
QBMElementAffectedByJobOBJECT_OR_COLUMN
dboQBM_FGIDBQueueActivityDisabledOBJECT_OR_COLUMN
dboQBM_FGIMaintenanceRunning_MOBJECT_OR_COLUMN
dboQBM_FGISessionContextOBJECT_OR_COLUMN
dboQBM_FGISessionErrorIsDeadlockOBJECT_OR_COLUMN
dboQBM_FGISessionErrorRethrowOBJECT_OR_COLUMN

Source excerpt

First extracted SQL definition lines from the exported source. Use the full source page for complete context.

Open full formatted source

1  create   procedure QBM_PWorkJobQueueDelete as begin declare @ErrorMessage nvarchar(4000) declare @ErrorSeverity int declare @ErrorState int declare
2 @procname nvarchar(256) = object_name(@@procid) declare @Starttime datetime = getutcdate() declare @RunningMinutesMax int = 5 declare @AnzahlJobQueue 
3int = 1 declare @AnzahlJobQueueStats int = 1 declare @XUser nvarchar(64) = object_name(@@procid) declare @GenProcID_R varchar(38) = dbo.QBM_FGISessionContext
4('') declare @XUser_R nvarchar(64) = dbo.QBM_FGISessionContext('XUser') SET XACT_ABORT OFF BEGIN TRY exec QBM_PSessionContextSet 'XUser', @XUser       
5   if 0 = (select min(sign(len(ISNULL(p.name, '')))) as StartBisHierGeschafft from ( values ('QBMModuleDef')  , ('JobQueue')  , ('QBM_PSessionErrorAdd'
6)   , ('QBM_FGISessionErrorIsDeadlock')   , ('QBM_FGIMaintenanceRunning_M') , ('QBM_FGIDBQueueActivityDisabled') , ('QBM_PJobQueueDelete') , ('QBM_PJobQueueStatsShrink'
7)  , ('QBM_PTransactionLevelCheck') , ('QBM_PWaitForSeconds') , ('QBMElementAffectedByJob') ) as v (ProcedureName) left outer join sys.objects p with (readpast
8) on p.name = v.ProcedureName ) begin goto EndLabel end   exec QBM_PDBQueueAgentInfoSet @procname    if dbo.QBM_FGIMaintenanceRunning_M(1) > ' ' begin 
9goto endLabel end  exec QBM_PTransactionLevelCheck 0, @@procid, 'at start' set deadlock_priority -10  set lock_timeout 50  while (@AnzahlJobQueue + @AnzahlJobQueueStats
10) > 0 and DATEDIFF(mi, @Starttime, getutcdate()) <= @RunningMinutesMax and dbo.QBM_FGIDBQueueActivityDisabled() = 0 begin set lock_timeout 50     if @AnzahlJobQueue
11 > 0 begin  BEGIN TRY exec @AnzahlJobQueue = QBM_PJobQueueDelete END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default if dbo.QBM_FGISessionErrorIsDeadlock
12(default) = 0 begin RAISERROR ('', 18, 1) WITH NOWAIT end else begin select @AnzahlJobQueue = 1 exec QBM_PSessionErrorClean end END CATCH end    if @AnzahlJobQueueStats
13 > 0 begin BEGIN TRY exec @AnzahlJobQueueStats = QBM_PJobQueueStatsShrink END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default if dbo.QBM_FGISessionErrorIsDeadlock
14(default) = 0 begin RAISERROR ('', 18, 1) WITH NOWAIT end else begin select @AnzahlJobQueueStats = 1 exec QBM_PSessionErrorClean end END CATCH end   exec
15 QBM_PWaitForSeconds 0.040 end  if exists (select top 1 1 from QBMElementAffectedByJob a with (readpast) left outer join JobQueue q with (readpast) on 
16a.UID_Job = q.UID_Job where q.UID_Job is null ) begin delete QBMElementAffectedByJob from QBMElementAffectedByJob a left outer join JobQueue q with (readpast
17) on a.UID_Job = q.UID_Job where q.UID_Job is null end  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow
18() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH endLabel: exec QBM_PSessionContextSet 'GenProcID', @GenProcID_R exec QBM_PSessionContextSet 'XUser'
19, @XUser_R  exec QBM_PDBQueueAgentInfoSet @procname, 1 set lock_timeout -1 return end 
20

Module relation graph

Loading module relation graph…

Source-derived context

Generated from exported SQL module definitions plus read-only sandbox sys.objects/sys.parameters/sys.sql_expression_dependencies metadata. This is factual source evidence, not a semantic guess.

provenance: SQL definition export provenance: sandbox DB metadata modified: 2026-04-14T23:16:09.013

uses session context values has TRY/CATCH error handling

Summary: calls QBM_PSessionContextSet, QBM_PDBQueueAgentInfoSet, QBM_PTransactionLevelCheck, QBM_PJobQueueDelete, QBM_PSessionErrorAdd…; writes DELETE QBMElementAffectedByJob; reads/joins sys, QBMElementAffectedByJob, JobQueue; uses session context XUser, GenProcID

Declared parameters

No declared parameters in sys.parameters for this object, or metadata was not available.

DML targets

DELETE QBMElementAffectedByJob

Config/session

Config: None extracted.

Session: XUser GenProcID

DBQueue/tasks

None extracted.

Temp tables / referenced variables

Temp: None extracted.

Variables: @ErrorMessage @ErrorSeverity @ErrorState @procname @procid @Starttime @RunningMinutesMax @AnzahlJobQueue @AnzahlJobQueueStats @XUser @GenProcID_R @XUser_R @Rethrow

Referenced by / reverse dependencies

Generated from live DB metadata, FK rows, and exported SQL dependency/source extraction. This is factual linkage evidence, not inferred behavior.

No reverse dependencies extracted.