dbo.QBM_PJobRestart
SQL_STORED_PROCEDURE
Created 2025-06-27T18:01:00.423 · modified 2026-04-14T23:20:31.893 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
@DestJobName | nvarchar | no |
@uid_job | varchar | no |
@MinutesToDelay | int | no |
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| Job | OBJECT_OR_COLUMN | ||
| JobQueue | OBJECT_OR_COLUMN | ||
| QBM_PExecuteSQLWithRetry_LLP | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| QBM_YJobQueueShadow | TYPE | ||
| QBM_YSingleGUID | TYPE | ||
| dbo | QBM_FCVDatetimeToString | 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_PJobRestart ( @DestJobName nvarchar(255), @uid_job varchar(38), @MinutesToDelay int ) as begin declare @uid_destjob 2 varchar(38) declare @errmsg nvarchar(255) declare @Nachfolger QBM_YSingleGUID declare @CurrentTree QBM_YJobQueueShadow declare @CountItems int declare 3 @MinutesToDelay_intern int declare @XUser nvarchar(64) = object_name(@@procid) declare @Xdate datetime = getutcdate() declare @UID_Tree varchar(38) 4 declare @SQL nvarchar(max) SET XACT_ABORT OFF BEGIN TRY if isnull(@MinutesToDelay, 0) <= 0 begin select @MinutesToDelay_intern = 0 end else begin select 5 @MinutesToDelay_intern = @MinutesToDelay end select top 1 @UID_Tree = q.UID_Tree from JobQueue q with (readpast) where q.UID_Job = @uid_job if @UID_Tree 6 is null begin select @errmsg = '#LDS#Process chain to reactivate not found. ({0}).|' + @uid_job + N'|' raiserror (@errmsg, 18, 1) with nowait end update 7 JobQueue set XUserUpdated = 'prepare QBM_PJobRestart' from JobQueue q where q.UID_Tree = @UID_Tree insert into @CurrentTree(UID_Job, Ready2EXE, StartAt 8, UID_JobSameServer , UID_JobError, UID_JobOrigin, UID_JobSuccess, UID_Tree) select q.UID_Job, q.Ready2EXE, q.StartAt, q.UID_JobSameServer , UID_JobError 9, UID_JobOrigin, UID_JobSuccess, UID_Tree from JobQueue q where q.UID_Tree = @UID_Tree select @uid_destjob = null select top 1 @uid_destjob = qz.UID_Job 10 from @CurrentTree q join Job j with(readpast) on q.UID_JobOrigin = j.UID_Job and q.UID_Job = @uid_job join Job jd with(readpast) on jd.UID_JobChain 11= j.UID_JobChain and jd.Name = @DestJobName join @CurrentTree qz on qz.uid_jobOrigin = jd.uid_job if @uid_destjob is null begin select @errmsg = '#LDS#Process step to reactivate not found. ({0}).|' 12 + @DestJobName + N'|' raiserror (@errmsg, 18, 1) with nowait end insert into @Nachfolger (UID_SingleGuid ) select @uid_destjob select @CountItems = 131 while @CountItems > 0 begin insert into @Nachfolger (UID_SingleGuid ) select distinct q.UID_JobSuccess from @CurrentTree q where exists (select top 1 14 1 from @Nachfolger x where x.UID_SingleGuid = q.UID_Job) and not exists (select top 1 1 from @Nachfolger x where x.UID_SingleGuid = q.UID_JobSuccess 15) and q.UID_JobSuccess > ' ' select @CountItems = @@rowcount insert into @Nachfolger (UID_SingleGuid ) select distinct q.UID_JobError from @CurrentTree 16 q where exists (select top 1 1 from @Nachfolger x where x.UID_SingleGuid = q.uid_job) and not exists (select top 1 1 from @Nachfolger x where x.UID_SingleGuid 17 = q.UID_JobError) and q.UID_JobError > ' ' select @CountItems += @@rowcount end update @CurrentTree set Ready2Exe = N'FINISHED' , IsRecordModified 18 = 1 from @CurrentTree q where q.Ready2EXE in ( N'MISSING', N'LOADED', N'PROCESSING', N'TRUE') AND NOT EXISTS ( SELECT top 1 1 FROM @Nachfolger x WHERE 19 x.UID_SingleGuid = q.UID_Job ) update @CurrentTree set Ready2Exe = N'FALSE' , UID_JobSameServer = q.UID_Job , IsRecordModified = 1 from @CurrentTree 20 q where ( q.UID_Job in (select n.UID_SingleGuid from @nachfolger n) or q.Ready2EXE in ( N'MISSING', N'LOADED', N'PROCESSING') ) and q.UID_Job <> @uid_destjob 21 update @CurrentTree set Ready2Exe = N'TRUE' , StartAt = dateadd(mi, @MinutesToDelay_intern, GetUTCDate()) , UID_JobSameServer = q.UID_Job , IsRecordModified 22 = 1 from @CurrentTree q where q.UID_Job = @uid_destjob if exists (select top 1 1 from @CurrentTree q where q.Ready2EXE not in (N'TRUE', N'FALSE', N'FINISHED' 23) ) begin update @CurrentTree set UID_JobSameServer = q.UID_Job , IsRecordModified = 1 from @CurrentTree q where q.UID_JobSameServer <> q.UID_Job end 24 select top 1 @SQL = STRING_AGG (convert(nvarchar(max), x.zeile) , ';') from ( select CONCAT('update JobQueue 25 set UID_JobSameServer = ''', cu.UID_JobSameServer 26 , ''' 27 , StartAt = ''' , dbo.QBM_FCVDatetimeToString( cu.StartAt ), ''' 28 , Ready2EXE = ''', cu.Ready2Exe , ''' 29 --34101 30 , XDateUpdated = ''' 31, dbo.QBM_FCVDatetimeToString(@Xdate) , ''' 32 , XUserUpdated = ''', @XUser , ''' 33 where UID_Job = ''', cu.UID_Job , ''' 34 ') as zeile from @CurrentTree 35 cu where cu.IsRecordModified = 1 ) as x exec QBM_PExecuteSQLWithRetry_LLP @SQL END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default 36 declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH endLabel: set deadlock_priority normal 37 return end 38
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:20:31.893
has TRY/CATCH error handling
Summary: calls QBM_PExecuteSQLWithRetry_LLP, QBM_PSessionErrorAdd; writes INSERT into, UPDATE JobQueue; reads/joins JobQueue, Job
Declared parameters
| Parameter | Type | Direction |
|---|---|---|
@DestJobName | nvarchar(255) | input |
@uid_job | varchar(38) | input |
@MinutesToDelay | int | input |
DML targets
INSERT into UPDATE JobQueueCalled routines
SQL dependency metadata
Config/session
Config: None extracted.
Session: None extracted.
DBQueue/tasks
None extracted.Temp tables / referenced variables
Temp: #LDS #Process
Variables: @DestJobName @uid_job @MinutesToDelay @uid_destjob @errmsg @Nachfolger @CurrentTree @CountItems @MinutesToDelay_intern @XUser @procid @Xdate @UID_Tree @SQL @rowcount @nachfolger @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.