dbo.QBM_PWorkMaintenance
SQL_STORED_PROCEDURE
Created 2025-06-27T17:57:37.230 · modified 2026-04-14T23:16:08.977 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
| No parameters. | ||
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| JobQueue | OBJECT_OR_COLUMN | ||
| QBM_PDBQueueAgentInfoSet | OBJECT_OR_COLUMN | ||
| QBM_PJournal | OBJECT_OR_COLUMN | ||
| QBM_PSessionContextSet | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorClean | OBJECT_OR_COLUMN | ||
| QBM_PTransactionLevelCheck | OBJECT_OR_COLUMN | ||
| QBM_YCursorbuffer | TYPE | ||
| dbo | QBM_FCVJobParameterToList | OBJECT_OR_COLUMN | |
| dbo | QBM_FGIDBQueueActivityDisabled | OBJECT_OR_COLUMN | |
| dbo | QBM_FGISessionContext | OBJECT_OR_COLUMN | |
| dbo | QBM_FGISessionErrorForLog | OBJECT_OR_COLUMN | |
| dbo | QBM_FGISessionErrorIsDeadlock | OBJECT_OR_COLUMN | |
| dbo | QBM_FGISessionErrorRethrow | OBJECT_OR_COLUMN |
Source excerpt
First extracted SQL definition lines from the exported source. Use the full source page for complete context.
1 create procedure QBM_PWorkMaintenance as begin declare @procname nvarchar(256) = object_name(@@procid) declare @UID_Job varchar(38) declare 2 @ParamIn nvarchar(max) declare @SQLCmd nvarchar(max) declare @DebugSwitch int = 0 declare @angefangen datetime = getutcdate() declare @DebugMessage nvarchar 3(max) declare @DebugLevel varchar(1) = 'W' declare @XUser nvarchar(64) = object_name(@@procid) declare @Xdate datetime = getutcdate() declare @StatementBuffer 4 QBM_YCursorbuffer declare @ElementCount int declare @ElementIndex int = 1 declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() declare @GenProcID_R 5 varchar(38) = dbo.QBM_FGISessionContext('') declare @XUser_R nvarchar(64) = dbo.QBM_FGISessionContext('XUser') SET XACT_ABORT OFF BEGIN TRY exec QBM_PSessionContextSet 6 'XUser', @XUser if 0 = (select min(sign(len(ISNULL(p.name, '')))) as StartBisHierGeschafft from ( values ('QBMModuleDef') , ('JobQueue') , ('QBM_FCVJobParameterToList' 7) , ('QBM_PSessionErrorAdd') , ('QBM_FGIDBQueueActivityDisabled') , ('QBM_PJournal') , ('QBM_PTransactionLevelCheck') ) as v (ProcedureName) left outer 8 join sys.objects p with (readpast) on p.name = v.ProcedureName ) begin goto EndLabel end exec QBM_PDBQueueAgentInfoSet @procname exec QBM_PTransactionLevelCheck 9 0, @@procid, 'at start' set deadlock_priority 0 set lock_timeout 1000 if @DebugSwitch > 0 begin if exists ( select top 1 1 from JobQueue q with (readpast 10) where q.IsRootJob = 1 and q.ComponentClass = 'VI.JobService.JobComponents.SQLComponent' and q.TaskName = 'Execute SQL' and q.Queue = @procname and q.Ready2EXE 11 = 'TRUE' ) begin select @DebugMessage = 'Entry QBM_PWorkMaintenance with jobs' exec QBM_PJournal @DebugMessage, @@procid, 'D', @DebugLevel end end insert 12 into @StatementBuffer(UID1, ContentFull) select top 500 q.UID_Job, q.ParamIN from JobQueue q with (readpast) where q.IsRootJob = 1 and q.ComponentClass 13 = 'VI.JobService.JobComponents.SQLComponent' and q.TaskName = 'Execute SQL' and q.Queue = @procname and q.Ready2EXE = 'TRUE' order by q.StartAt select 14 @ElementCount = @@ROWCOUNT while DATEDIFF(ss, @angefangen, getutcdate()) < 59 and dbo.QBM_FGIDBQueueActivityDisabled() = 0 and @ElementIndex <= @ElementCount 15 begin select top 1 @UID_Job = bu.UID1 , @ParamIn = bu.ContentFull from @StatementBuffer bu where bu.ElementIndex = @ElementIndex select top 1 @SQLCmd 16= x.ParameterValue from dbo.QBM_FCVJobParameterToList(@paramin)x where x.ParameterName = 'SQLStmt' if @DebugSwitch > 0 begin print @sqlcmd end BEGIN TRY 17 exec QBM_PSessionErrorClean exec sp_executesql @SQLCmd update JobQueue set Ready2EXE = 'DELETE' , XDateUpdated = @Xdate , XUserUpdated = @XUser where 18 UID_Job = @UID_Job END TRY BEGIN CATCH if dbo.QBM_FGISessionErrorIsDeadlock(default) = 0 begin if @DebugSwitch > 0 begin select dbo.QBM_FGISessionErrorForLog 19() end exec QBM_PSessionErrorAdd default RAISERROR (@Rethrow, 18, 1) WITH NOWAIT end END CATCH select @ElementIndex += 1 end END TRY BEGIN CATCH exec 20 QBM_PSessionErrorAdd default RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH endLabel: exec QBM_PSessionContextSet 'GenProcID', @GenProcID_R exec QBM_PSessionContextSet 21 'XUser', @XUser_R exec QBM_PDBQueueAgentInfoSet @procname, 1 set lock_timeout -1 return end 22
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:08.977
uses session context values has TRY/CATCH error handling
Summary: calls QBM_PSessionContextSet, QBM_PDBQueueAgentInfoSet, QBM_PTransactionLevelCheck, SQL, QBM_PJournal…; writes INSERT into, UPDATE JobQueue; reads/joins sys, JobQueue, QBM_FCVJobParameterToList; uses session context XUser, GenProcID
Declared parameters
No declared parameters in sys.parameters for this object, or metadata was not available.
DML targets
INSERT into UPDATE JobQueueCalled routines
Read/join references
SQL dependency metadata
- JobQueue
- QBM_PDBQueueAgentInfoSet
- QBM_PJournal
- QBM_PSessionContextSet
- QBM_PSessionErrorAdd
- QBM_PSessionErrorClean
- QBM_PTransactionLevelCheck
- QBM_YCursorbuffer
- dbo.QBM_FCVJobParameterToList
- dbo.QBM_FGIDBQueueActivityDisabled
- dbo.QBM_FGISessionContext
- dbo.QBM_FGISessionErrorForLog
- dbo.QBM_FGISessionErrorIsDeadlock
- dbo.QBM_FGISessionErrorRethrow
Config/session
Config: None extracted.
Session: XUser GenProcID
DBQueue/tasks
None extracted.Temp tables / referenced variables
Temp: None extracted.
Variables: @procname @procid @UID_Job @ParamIn @SQLCmd @DebugSwitch @angefangen @DebugMessage @DebugLevel @XUser @Xdate @StatementBuffer @ElementCount @ElementIndex @Rethrow @GenProcID_R @XUser_R @ROWCOUNT @paramin @sqlcmd
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.