dbo.QBM_PDialogProcessShrink_3
SQL_STORED_PROCEDURE
Created 2025-06-27T17:57:29.320 · modified 2026-04-14T23:20:25.997 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
@AnzahlGesamt | int | yes |
@KeyPattern | varchar | no |
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| DialogProcessSubstitute | OBJECT_OR_COLUMN | ||
| QBM_PExecuteSQLWithRetry_LLP | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| QBM_YCursorBuffer | TYPE | ||
| 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_PDialogProcessShrink_3 (@AnzahlGesamt int output , @KeyPattern varchar(25) = '%' ) as begin declare @CountItems int select 2 @AnzahlGesamt = 0 declare @GenProcIDNew varchar(38), @GenProcIDOrigin varchar(38) declare @ElementBuffer QBM_YCursorBuffer declare @ElementCount int 3declare @ElementIndex int declare @Pattern nvarchar(max) = ' 4 update DialogProcess 5 set ReadyForDeleteOrExport = 0 6 where GenProcID = ''@GenProcIDOrigin'' 7 and ReadyForDeleteOrExport > 0 8 9 update DialogDBQueue set GenProcID = ''@GenProcIDOrigin'' 10 from DialogDBQueue q 11 where q.GenProcID = ''@GenProcIDNew'' 12 -- 26962 13 and q.Generation >= 0 14 15 update QBMDBQueueCurrent set GenProcID = ''@GenProcIDOrigin'' where GenProcID = ''@GenProcIDNew'' 16 update DialogDeferredOperation set GenProcID = ''@GenProcIDOrigin'' where GenProcID = ''@GenProcIDNew'' 17 update JobQueue set GenProcID = ''@GenProcIDOrigin'' where GenProcID = ''@GenProcIDNew'' 18 19 update DialogProcessChain set GenProcID = ''@GenProcIDOrigin'' where GenProcID = ''@GenProcIDNew'' 20 update DialogWatchOperation set GenProcID = ''@GenProcIDOrigin'' where GenProcID = ''@GenProcIDNew'' 21 update JobHistory set GenProcID = ''@GenProcIDOrigin'' where GenProcID = ''@GenProcIDNew'' 22' 23 declare @SQLCmdWithRetry nvarchar(max) SET XACT_ABORT OFF BEGIN TRY insert into @ElementBuffer(UID1, UID2) select fi.GenProcIDNew, fi.GenProcIDOrigin 24from ( select GenProcIDOrigin, GenProcIDNew , COUNT(*) over (partition by GenProcIDNew) as AnzahlNew from DialogProcessSubstitute s where s.GenProcIDNew 25 like @KeyPattern and s.ReadyForDeleteOrExport = 0 ) as fi where fi.AnzahlNew = 1 select @ElementCount = @@rowcount select @ElementIndex = 1 while @ElementIndex 26 <= @ElementCount begin select top 1 @GenProcIDNew = bu.UID1 , @GenProcIDOrigin = bu.UID2 from @ElementBuffer bu where bu.ElementIndex = @ElementIndex 27select @SQLCmdWithRetry = replace(replace(@Pattern , '@GenProcIDOrigin', @GenProcIDOrigin) , '@GenProcIDNew', @GenProcIDNew) exec QBM_PExecuteSQLWithRetry_LLP 28 @SQLStatement = @SQLCmdWithRetry , @LockTimeout_ms = default , @MaxWaitTimeForLock_s = default , @ProcIDForJournal = default , @HandleErrorSilent = 1 29, @ExecuteWithTransact = 0 update DialogProcessSubstitute set ReadyForDeleteOrExport = 1 from DialogProcessSubstitute s where s.GenProcIDNew = @GenProcIDNew 30 and s.ReadyForDeleteOrExport <> 1 select @CountItems = @@rowcount select @Anzahlgesamt = @Anzahlgesamt + @CountItems select @ElementIndex += 1 end END 31 TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT 32 END CATCH end 33
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:25.997
has TRY/CATCH error handling
Summary: calls QBM_PExecuteSQLWithRetry_LLP, QBM_PSessionErrorAdd; writes INSERT into, UPDATE DialogProcess, UPDATE DialogDBQueue, UPDATE QBMDBQueueCurrent, UPDATE DialogDeferredOperation…; reads/joins DialogDBQueue, DialogProcessSubstitute
Declared parameters
| Parameter | Type | Direction |
|---|---|---|
@AnzahlGesamt | int | OUTPUT |
@KeyPattern | varchar(25) | input |
DML targets
INSERT into UPDATE DialogProcess UPDATE DialogDBQueue UPDATE QBMDBQueueCurrent UPDATE DialogDeferredOperation UPDATE JobQueue UPDATE DialogProcessChain UPDATE DialogWatchOperation UPDATE JobHistory UPDATE DialogProcessSubstituteCalled routines
Read/join references
SQL dependency metadata
Config/session
Config: None extracted.
Session: None extracted.
DBQueue/tasks
None extracted.Temp tables / referenced variables
Temp: None extracted.
Variables: @AnzahlGesamt @KeyPattern @CountItems @GenProcIDNew @GenProcIDOrigin @ElementBuffer @ElementCount @ElementIndex @Pattern @SQLCmdWithRetry @rowcount @SQLStatement @LockTimeout_ms @MaxWaitTimeForLock_s @ProcIDForJournal @HandleErrorSilent @ExecuteWithTransact @Anzahlgesamt @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.
| Referencing object | Relation | Evidence |
|---|---|---|
| dbo.QBM_PProcessShrink | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_PProcessShrink | source text reference | has TRY/CATCH error handling |