dbo.QBM_PWorkSchedule
SQL_STORED_PROCEDURE
Created 2025-06-27T17:57:37.320 · modified 2026-04-14T23:16:09.033 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
| No parameters. | ||
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| DialogDatabase | OBJECT_OR_COLUMN | ||
| DialogDBQueue | OBJECT_OR_COLUMN | ||
| dialogdeferredoperation | OBJECT_OR_COLUMN | ||
| QBM_PDBQueueAgentInfoSet | OBJECT_OR_COLUMN | ||
| QBM_PDBQueueInsert_Single | OBJECT_OR_COLUMN | ||
| QBM_PJournal | OBJECT_OR_COLUMN | ||
| QBM_PScheduleCheck | OBJECT_OR_COLUMN | ||
| QBM_PSessionContextSet | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorClean | OBJECT_OR_COLUMN | ||
| QBM_PTransactionLevelCheck | OBJECT_OR_COLUMN | ||
| QBMDBQueueCurrent | OBJECT_OR_COLUMN | ||
| QBMGuidReplace | OBJECT_OR_COLUMN | ||
| dbo | QBM_FGIDBServerIsActive | OBJECT_OR_COLUMN | |
| dbo | QBM_FGISessionContext | 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_PWorkSchedule as begin declare @procname nvarchar(256) = object_name(@@procid) declare @GenProcID varchar(38) = newid() 2 declare @Xuser nvarchar(64) = object_name(@@procid) declare @SingleUserProcess int declare @SingleUserStart datetime declare @SingleUserReturnCode int 3 declare @SecondsUntilResetSingleUser int = 600 declare @GenProcID_R varchar(38) = dbo.QBM_FGISessionContext('') declare @XUser_R nvarchar(64) = dbo.QBM_FGISessionContext 4('XUser') declare @DebugLevel varchar(1) = 'W' SET XACT_ABORT OFF BEGIN TRY if 0 = (select min(sign(len(ISNULL(p.name, '')))) as StartBisHierGeschafft 5 from ( values ('QBMModuleDef') , ('DialogDatabase') , ('DialogDBQueue') , ('DialogDeferredOperation') , ('QBM_FGIDBServerIsActive') , ('QBM_PSessionErrorAdd' 6) , ('QBM_FGISessionErrorIsDeadlock') , ('QBM_PDBQueueInsert_Single') , ('QBM_PSessionContextSet') , ('QBMDBQueueCurrent') , ('QBMGuidReplace') ) 7 as v (ProcedureName) left outer join sys.objects p with (readpast) on p.name = v.ProcedureName ) begin goto EndLabel end exec QBM_PDBQueueAgentInfoSet 8 @procname exec QBM_PTransactionLevelCheck 0, @@procid, 'at start' set deadlock_priority 0 set lock_timeout 5000 select top 1 @SingleUserProcess = d.SingleUserProcess 9 , @SingleUserStart = d.SingleUserStart from DialogDatabase d with (readpast) where d.IsMainDatabase = 1 if @SingleUserProcess is null begin select @SingleUserProcess 10 = 0 end if @SingleUserProcess <> 0 begin if @SingleUserProcess > 0 begin select @SingleUserReturnCode = dbo.QBM_FGIDBServerIsActive(@SingleUserProcess 11, @SecondsUntilResetSingleUser) if @SingleUserReturnCode in (-1, -2) begin update DialogDatabase set SingleUserProcess = 0 , SingleUserStart = null where 12 IsMainDatabase = 1 end if @SingleUserReturnCode in (0) begin if DATEADD(ss, @SecondsUntilResetSingleUser, @SingleUserStart) < getutcdate() begin update 13 DialogDatabase set SingleUserProcess = 0 , SingleUserStart = null where IsMainDatabase = 1 end end end end else begin exec QBM_PSessionContextSet 'GenProcID' 14, @GenProcID exec QBM_PSessionContextSet 'XUser', @XUser exec QBM_PScheduleCheck if not exists (select top 1 1 from QBMDBQueueCurrent cu with (nolock 15) where cu.UID_Task in ( 'QBM-K-TableReload' , 'QBM-K-TableReplace' ) and cu.SlotNumber > 0 ) and exists (select top 1 1 from QBMGuidReplace r join 16DialogDatabase d on r.UID_Database = d.UID_Database where d.IsMainDatabase = 1 ) begin if not exists (select top 1 1 from QBMDBQueueCurrent cu with (nolock 17) where cu.SlotNumber <> 0 and cu.UID_Task in ('QBM-K-TableReload' , 'QBM-K-TableReplace' ) ) and not exists (select top 1 1 from DialogDBQueue q with 18(nolock) where q.UID_Task in ('QBM-K-TableReload' , 'QBM-K-TableReplace', 'QBM-K-GUIDReplaceReady' ) ) begin exec QBM_PDBQueueInsert_Single 'QBM-K-Commonrecalculate' 19, 'QBM-K-TableReplace', '', @GenProcID exec QBM_PDBQueueInsert_Single 'QBM-K-GUIDReplaceReady', '', '', @GenProcID end end end if exists (select top 201 1 from dialogdeferredoperation where TargetDate < GetUTCDate() and isnull(xtouched, '') <> 'X' ) begin exec QBM_PDBQueueInsert_Single 'QBM-K-DeferredOperationExecute' 21 , null, null, @GenprocID end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default if dbo.QBM_FGISessionErrorIsDeadlock(default) = 0 begin declare @Rethrow 22 varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT end else begin exec QBM_PJournal 'SessionError', @@procid, 'I' 23, @DebugLevel exec QBM_PSessionErrorClean end END CATCH endLabel: exec QBM_PSessionContextSet 'GenProcID', @GenProcID_R exec QBM_PSessionContextSet 'XUser' 24, @XUser_R exec QBM_PDBQueueAgentInfoSet @procname, 1 set lock_timeout -1 return end 25
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.033
inserts DBQueue tasks uses session context values has TRY/CATCH error handling
Summary: calls QBM_PDBQueueAgentInfoSet, QBM_PTransactionLevelCheck, QBM_PSessionContextSet, QBM_PScheduleCheck, QBM_PDBQueueInsert_Single…; writes UPDATE DialogDatabase; reads/joins sys, DialogDatabase, QBMDBQueueCurrent, QBMGuidReplace, DialogDBQueue…; uses session context XUser, GenProcID
Declared parameters
No declared parameters in sys.parameters for this object, or metadata was not available.
DML targets
UPDATE DialogDatabaseCalled routines
Read/join references
SQL dependency metadata
- DialogDatabase
- DialogDBQueue
- dialogdeferredoperation
- QBM_PDBQueueAgentInfoSet
- QBM_PDBQueueInsert_Single
- QBM_PJournal
- QBM_PScheduleCheck
- QBM_PSessionContextSet
- QBM_PSessionErrorAdd
- QBM_PSessionErrorClean
- QBM_PTransactionLevelCheck
- QBMDBQueueCurrent
- QBMGuidReplace
- dbo.QBM_FGIDBServerIsActive
- dbo.QBM_FGISessionContext
- dbo.QBM_FGISessionErrorIsDeadlock
- dbo.QBM_FGISessionErrorRethrow
Config/session
Config: None extracted.
Session: XUser GenProcID
DBQueue/tasks
) , ( QBM-K-TableReload QBM-K-TableReplace QBM-K-GUIDReplaceReady QBM-K-Commonrecalculate QBM-K-DeferredOperationExecuteTemp tables / referenced variables
Temp: None extracted.
Variables: @procname @procid @GenProcID @Xuser @SingleUserProcess @SingleUserStart @SingleUserReturnCode @SecondsUntilResetSingleUser @GenProcID_R @XUser_R @DebugLevel @XUser @GenprocID @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.