dbo.QBM_PProcessGroupCreate
SQL_STORED_PROCEDURE
Created 2025-06-27T17:57:37.160 · modified 2026-04-14T23:20:32.130 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
@MaxRuntime | int | no |
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| DialogProcess | OBJECT_OR_COLUMN | ||
| DialogProcessSubstitute | OBJECT_OR_COLUMN | ||
| QBM_PDialogProcessShrink_fill | OBJECT_OR_COLUMN | ||
| QBM_PJournal | OBJECT_OR_COLUMN | ||
| QBM_PProcessGroupCreate_help | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| dbo | QBM_FCVDatetimeToString | OBJECT_OR_COLUMN | |
| dbo | QBM_FCVStringToInt | OBJECT_OR_COLUMN | |
| dbo | QBM_FGIConfigparmValue | OBJECT_OR_COLUMN | |
| dbo | QBM_FGISessionErrorRethrow | OBJECT_OR_COLUMN | |
| dbo | QBM_FGITableCountAll | 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_PProcessGroupCreate ( @MaxRuntime int = 0 ) as begin set nocount on declare @lauf int declare @laufInnen int declare 2 @gesamtanzahl int declare @Limit int declare @DebugSwitch int = 0 declare @AnzahlInnerLoopCycles int = 0 declare @BlockSizeWork int declare @TableCountAll 3 int = dbo.QBM_FGITableCountAll('dialogprocess') declare @MussFertigSein datetime declare @Message nvarchar(1024) declare @XUser nvarchar(64) = object_name 4(@@procid) declare @Xdate datetime = getutcdate() BEGIN TRY drop table if exists #DialogProcessMirror create table #DialogProcessMirror ( UID_SingleGuid 5 varchar(38) collate database_default NOT NULL , BitProperty bit default 0 NULL , IntProperty int default 0 NULL , XDateUpdated datetime null ) drop table 6 if exists #sammler_Nachbearbeitung create table #sammler_Nachbearbeitung ( GenProcID varchar(38) collate database_default NULL , GenProcIDGroup varchar 7(38) collate database_default NULL , index QBM_YProcessGroupCreate1 (GenProcID, GenProcIDGroup) , index QBM_YProcessGroupCreate2 (GenProcIDGroup, GenProcID 8) ) select @BlockSizeWork = 1000 if @DebugSwitch > 0 begin print 'Start Vorbereitung ' + convert(nvarchar(64), GetUTCDate(), 121) end if dbo.QBM_FGIConfigparmValue 9('Common\ProcessState\ExportPolicy') not in ( 'HDB', 'FILE' ) and @DebugSwitch = 0 begin if @DebugSwitch > 0 begin print 'ExportPolicy paßt nicht' end 10 goto ende end select @limit = dbo.QBM_FCVStringToInt(dbo.QBM_FGIConfigparmValue('Common\ProcessState\PackageSizeHDB'), 10000) if @limit < 1 begin raiserror 11 ('#LDS#Value of config parameter Common\ProcessState\PackageSizeHDB must not be less than 1.|', 18, 2 ) with nowait end select @gesamtanzahl = 0 if @DebugSwitch 12 > 0 begin print '@limit ' + convert(varchar(64), @limit) end if @BlockSizeWork > @Limit begin select @BlockSizeWork = @Limit end exec QBM_PDialogProcessShrink_fill 13 @RepairSubstituteOnly = 1 if @DebugSwitch > 0 begin declare @startFill datetime = getutcdate() end insert into #DialogProcessMirror(UID_SingleGuid, IntProperty 14, BitProperty, XDateUpdated) select p.GenProcID, p.ReadyForDeleteOrExport, 0 as HasGroup, p.XDateUpdated from DialogProcess p create unique index #DialogProcessMirror_i 15 on #DialogProcessMirror(UID_SingleGuid) create index #DialogProcessMirror_Xdate on #DialogProcessMirror(XDateUpdated) if @DebugSwitch > 0 begin print 16concat( 'Dauer Befüllung', str(datediff(ss, @startfill, getutcdate()))) print 'Start MakeGroup ' + convert(nvarchar(64), GetUTCDate(), 121) end if @MaxRuntime 17 <= 0 begin select @MussFertigSein = DATEADD(dd, 1, getutcdate()) end else begin select @MussFertigSein = DATEADD(ss , @MaxRuntime * 4 / 5 , GETUTCDATE 18() ) end if @DebugSwitch > 0 begin print 'Ende Vorbereitung ' + convert(nvarchar(64), GetUTCDate(), 121) print '@MussFertigSein ' + dbo.QBM_FCVDatetimeToString 19(@MussFertigSein) end select @lauf = 1 while @lauf > 0 begin If not exists(select top 1 1 FROM #DialogProcessMirror p WHERE p.BitProperty = 0 AND p.IntProperty 20 = 2 ) or @MussFertigSein <= GETUTCDATE() begin SELECT @lauf = 0 if @DebugSwitch > 0 begin if @MussFertigSein <= GETUTCDATE() begin print 'ende wegen Zeitüberschreitung' 21 end else begin print 'ende wegen kein Fund mit ReadyForDeleteOrExport = 2 und ohne Gruppe' end end continue end exec QBM_PProcessGroupCreate_help @DebugSwitch 22 , @BlockSizeWork , @Gesamtanzahl output , @XUser , @Xdate , @Limit if @gesamtanzahl >= @limit begin select @lauf = 0 if @DebugSwitch > 0 begin print concat 23('ende wegen @gesamtanzahl (',str(@gesamtanzahl),') >= @limit (', str(@limit),')') end end end if @MussFertigSein <= GETUTCDATE() begin select @Message 24 = '#LDS#Group creation finished, because the maximum runtime {0} was reached (remote query timeout).|' + STR(@MaxRuntime) + '|' exec QBM_PJournal @message 25, @@PROCID, 'W', 'W' end if @DebugSwitch > 0 begin print 'Ende MakeGroup ' + convert(nvarchar(64), GetUTCDate(), 121) end update DialogProcess set GenProcIDGroup 26 = null , XDateUpdated = @Xdate , XUserUpdated = @XUser from DialogProcess p where p.GenProcIDGroup > ' ' and not exists (select top 1 1 from #DialogProcessMirror 27 m where m.UID_SingleGuid = p.GenProcID and m.BitProperty = 1 ) select @laufInnen = @@rowcount if @DebugSwitch > 0 begin print 'nachbehandelte Sätze ' 28+ str(@laufInnen) print 'Ende Bereinigung ' + convert(nvarchar(64), GetUTCDate(), 121) end truncate table #sammler_Nachbearbeitung insert into #sammler_Nachbearbeitung 29 (GenProcID, GenProcIDGroup) select p.GenProcID, p.GenProcIDGroup from DialogProcess p where p.GenProcIDGroup > ' ' and (exists (select top 1 1 from DialogProcessSubstitute 30 s1 join DialogProcess p1 on s1.GenProcIDNew = p1.GenProcID where s1.GenProcIDOrigin = p.GenProcID and p1.GenProcIDGroup is null) Or exists (select top 31 1 1 from DialogProcessSubstitute s1 join DialogProcess p1 on s1.GenProcIDOrigin = p1.GenProcID where s1.GenProcIDNew = p.GenProcID and p1.GenProcIDGroup 32 is null) ) select @AnzahlInnerLoopCycles = 0 select @laufInnen = 1 while @laufInnen > 0 begin select @laufInnen = 0 insert into #sammler_Nachbearbeitung 33 (GenProcID, GenProcIDGroup) select a.GenProcID, a.GenProcIDGroup from ( select x.GenProcID, x.GenProcIDGroup from ( select su.GenProcIDOrigin as GenProcID 34, s.GenProcIDGroup from #sammler_Nachbearbeitung s join DialogProcessSubstitute su on s.GenProcIDGroup = su.GenProcIDNew ) as x group by x.GenProcID, x.GenProcIDGroup 35 )as a left outer join #sammler_Nachbearbeitung e on e.GenProcID = a.GenProcID where e.GenProcID is null select @laufInnen += @@rowcount insert into #sammler_Nachbearbeitung 36 (GenProcID, GenProcIDGroup) select a.GenProcID, a.GenProcIDGroup from ( select x.GenProcID, x.GenProcIDGroup from ( select su.GenProcIDNew as GenProcID 37, s.GenProcIDGroup from #sammler_Nachbearbeitung s join DialogProcessSubstitute su on s.GenProcIDGroup = su.GenProcIDOrigin ) as x group by x.GenProcID 38, x.GenProcIDGroup )as a left outer join #sammler_Nachbearbeitung e on e.GenProcID = a.GenProcID where e.GenProcID is null select @laufInnen += @@rowcount 39 insert into #sammler_Nachbearbeitung (GenProcID, GenProcIDGroup) select a.GenProcID, a.GenProcIDGroup from ( select x.GenProcID, x.GenProcIDGroup from 40 ( select su.GenProcIDNew as GenProcID, s.GenProcIDGroup from #sammler_Nachbearbeitung s join DialogProcessSubstitute su on s.GenProcID = su.GenProcIDOrigin 41 ) as x group by x.GenProcID, x.GenProcIDGroup )as a left outer join #sammler_Nachbearbeitung e on e.GenProcID = a.GenProcID where e.GenProcID is null 42select @laufInnen += @@rowcount insert into #sammler_Nachbearbeitung (GenProcID, GenProcIDGroup) select a.GenProcID, a.GenProcIDGroup from ( select x.GenProcID 43, x.GenProcIDGroup from ( select su.GenProcIDOrigin as GenProcID, s.GenProcIDGroup from #sammler_Nachbearbeitung s join DialogProcessSubstitute su on 44s.GenProcID = su.GenProcIDNew ) as x group by x.GenProcID, x.GenProcIDGroup )as a left outer join #sammler_Nachbearbeitung e on e.GenProcID = a.GenProcID 45 where e.GenProcID is null select @laufInnen += @@rowcount select @AnzahlInnerLoopCycles += 1 end if @DebugSwitch > 0 begin print concat('Anzahl der Läufe für -- Nachbehandlung ... ' 46, str(@AnzahlInnerLoopCycles)) end update DialogProcess set GenProcIDGroup = null , XDateUpdated = @Xdate , XUserUpdated = @XUser from DialogProcess p 47 where p.GenProcIDGroup > ' ' and exists (select top 1 1 from #sammler_Nachbearbeitung s where s.GenProcID = p.GenProcID ) select @laufInnen = @@rowcount 48 if @DebugSwitch > 0 begin print 'nochmals nachbehandelte Sätze ' + str(@laufInnen) print 'wirkliches Ende Bereinigung ' + convert(nvarchar(64), GetUTCDate 49(), 121) end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow 50, 18, 1) WITH NOWAIT END CATCH ende: return end 51
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:32.130
has TRY/CATCH error handling
Summary: calls QBM_PDialogProcessShrink_fill, QBM_PProcessGroupCreate_help, QBM_PJournal, QBM_PSessionErrorAdd; writes INSERT into, UPDATE DialogProcess; reads/joins DialogProcess, DialogProcessSubstitute; uses config Common\ProcessState\ExportPolicy, Common\ProcessState\PackageSizeHDB
Declared parameters
| Parameter | Type | Direction |
|---|---|---|
@MaxRuntime | int | input |
DML targets
INSERT into UPDATE DialogProcessCalled routines
Read/join references
SQL dependency metadata
Config/session
Config: Common\ProcessState\ExportPolicy Common\ProcessState\PackageSizeHDB
Session: None extracted.
DBQueue/tasks
None extracted.Temp tables / referenced variables
Temp: #DialogProcessMirror #sammler_Nachbearbeitung #LDS #Value #DialogProcessMirror_i #DialogProcessMirror_Xdate #Group
Variables: @MaxRuntime @lauf @laufInnen @gesamtanzahl @Limit @DebugSwitch @AnzahlInnerLoopCycles @BlockSizeWork @TableCountAll @MussFertigSein @Message @XUser @procid @Xdate @limit @RepairSubstituteOnly @startFill @startfill @Gesamtanzahl @message @PROCID @rowcount @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.