dbo.QBM_PDBQueueInsert_Int

SQL_STORED_PROCEDURE

Created 2025-06-27T17:57:37.497 · modified 2026-04-14T23:16:09.157 · source: live DB sys.objects/sys.sql_expression_dependencies.

Open formatted source/search result

Parameters

NameTypeOutput
@UID_Taskvarcharno
@DBQueueElementsQBM_YDBQueueRawno

Referenced objects

SchemaObjectColumn/minorClass
DialogDatabaseOBJECT_OR_COLUMN
DialogDBQueueOBJECT_OR_COLUMN
DialogTableOBJECT_OR_COLUMN
QBM_PDBQueueInsert_SingleOBJECT_OR_COLUMN
QBM_PJournalOBJECT_OR_COLUMN
QBM_PSessionContextSetOBJECT_OR_COLUMN
QBM_PSessionErrorAddOBJECT_OR_COLUMN
QBM_YDBQueueRawTYPE
QBM_YSessionErrorTYPE
QBMDBQueueTaskOBJECT_OR_COLUMN
QBMDBQueueTaskMetricOBJECT_OR_COLUMN
dboQBM_FGIConfigparmValueOBJECT_OR_COLUMN
dboQBM_FGISessionContextOBJECT_OR_COLUMN

Source excerpt

First extracted SQL definition lines from the exported source. Use the full source page for complete context.

Open full formatted source

1      create   procedure QBM_PDBQueueInsert_Int (@UID_Task varchar(38) , @DBQueueElements QBM_YDBQueueRaw readonly          ) as begin  declare 
2@msg nvarchar(255) declare @PathLength_intern int  declare @UID_TaskAutomatedFollower varchar(38) declare @UID_TaskAutomatedPredecessor varchar(38) declare
3 @IsNoGenProcIDCheck bit declare @CountParameter int   declare @GenProcID_R varchar(38) = dbo.QBM_FGISessionContext('') declare @XUser_R nvarchar(64) =
4 dbo.QBM_FGISessionContext('XUser') declare @myName nvarchar(64) declare @UID_Task_Intern varchar(38) declare @DebugStarttime datetime = getutcdate() declare
5 @DebugLevel char(1) = 'W' declare @DebugMessage nvarchar(4000) declare @DebugSwitch int = 0 declare @GenProcIDForAutomated varchar(38)  declare @RowsFilledIn
6 int = 0  declare @Compressed QBM_YDBQueueRaw declare @ErrorBuffer QBM_YSessionError SET XACT_ABORT OFF BEGIN TRY  if not exists (select top 1 1 from @DBQueueElements
7 ) begin goto endlabel end select top 1 @GenProcIDForAutomated = e.GenProcID from @DBQueueElements e select @myName = 'QBM_PDBQueueInsert_Bulk'    if @UID_Task
8 in ('QBM-K-CommonWaitForCompiler' , 'QBM-K-BaseMigrationReady') begin update DialogDatabase set UID_CutOffTask = @UID_Task where IsMainDatabase = 1 end
9 exec QBM_PSessionContextSet 'GenProcID', @GenProcID_R exec QBM_PSessionContextSet 'XUser', @myName select @Debugmessage = concat('inserted task ' , @UID_Task
10) if @DebugSwitch > 0 begin exec QBM_PJournal @Debugmessage, @@procid, 'D', @DebugLevel end select top 1 @UID_Task_Intern = t.uid_task , @CountParameter
11 = t.CountParameter , @UID_TaskAutomatedFollower = t.UID_TaskAutomatedFollower , @UID_TaskAutomatedPredecessor = t.UID_TaskAutomatedPredecessor , @IsNoGenProcIDCheck
12 = t.IsNoGenProcIDCheck , @PathLength_intern = t.PathLength from QBMDBQueueTaskMetric t with (readpast)  where UID_Task = @UID_Task if isnull(@UID_Task_Intern
13,'') = '' begin  select top 1 @UID_Task_Intern = t.uid_task , @CountParameter = t.CountParameter , @UID_TaskAutomatedFollower = t.UID_TaskAutomatedFollower
14 , @UID_TaskAutomatedPredecessor = t.UID_TaskAutomatedPredecessor , @IsNoGenProcIDCheck = t.IsNoGenProcIDCheck , @PathLength_intern = 11  from QBMDBQueueTask
15 t with (readpast) where UID_Task = @UID_Task if isnull(@UID_Task_Intern,'') = '' begin delete @ErrorBuffer insert into @ErrorBuffer (ErrorMessage, ErrorSeverity
16, ErrorState, ErrorNumber , ProcedureName, ProcedureLine, MessageDate , GenProcID, RepeatCounter, IsReThrow, SourceCode) select concat( '#LDS#Internal error: no valid Task given ({0}).|'
17 , isnull(@UID_Task, '<empty>') , '|.' ),18, 1, 50000 , object_name(@@procid), ERROR_LINE(), GETUTCDATE() , null, 0, 0, null exec QBM_PSessionErrorAdd 
18@ErrorBuffer set XACT_ABORT ON  RAISERROR('', 18, 1) with nowait end end if @DebugSwitch > 0 begin print @myName + ' task ' + @UID_Task + ' nestlevel '
19 + str(@@nestlevel) print 'CountItems Parameter ' + str(@CountParameter)         end if @CountParameter > 0 begin            if exists (select top 1 1 
20from @DBQueueElements e where isnull(e.GenProcID, '') = '' ) begin  select @msg = '#LDS#Internal error: no GenProcID given.|' RAISERROR(@msg, 18, 1) with
21 nowait  end end  if @IsNoGenProcIDCheck = 0 begin if '1' <> dbo.QBM_FGIConfigparmValue('Common\ProcessState') begin select @IsNoGenProcIDCheck = 1 end
22 end if @UID_Task_Intern in ('QBM-K-CommonReCalculate'  ) begin insert into DialogDBQueue (UID_DialogDBQueue, UID_Task, object, SubObject, PathLength, 
23GenProcID) select newid(), @UID_Task_Intern, x.Object , null, t.PathLength as PathLength , x.GenProcID from ( select e.Object as Object, MAX(e.GenProcID
24) as GenprocID from @DBQueueElements e where e.Object > ' ' group by e.Object ) as x join QBMDBQueueTaskMetric t with (readpast) on x.Object = t.uid_task
25   where Not exists (select top 1 1 from DialogDBQueue q with (readpast) where q.UID_Task = @UID_Task_Intern and q.Object = x.Object    and q.Generation
26 >= 0 )  select @RowsFilledIn = @@ROWCOUNT if @RowsFilledIn > 0 begin  exec QBM_PSessionContextSet 'INSERTEDINTODBQUEUE', '1' end goto EndLabel end  if
27 @UID_Task_Intern in ('QBM-K-XMarkedForDeletionPush', 'QBM-K-XDateSubItemUpdate', 'QBM-K-XDateSubItemUpdateFU') begin if exists (select top 1 1 from @DBQueueElements
28 e join DialogTable t with (readpast) on e.Object = t.UID_DialogTable ) begin set XACT_ABORT ON  RAISERROR ('#LDS#Invalid parameter order.|', 18, 1) WITH
29 NOWAIT end end  if @UID_Task_Intern in ('QBM-K-CommonTaskStart') begin if exists (select top 1 1 from @DBQueueElements e join DialogTable t with (readpast
30) on e.Object = t.UID_DialogTable ) begin set XACT_ABORT ON  RAISERROR ('#LDS#Invalid Task QBM-K-CommonTaskStart.|', 18, 1) WITH NOWAIT end end if @CountParameter
31 = 0 begin if @IsNoGenProcIDCheck = 0 begin                       insert into DialogDBQueue (uid_DialogDBQueue, UID_Task, object, SubObject, PathLength
32, GenProcID) select newid(), @UID_Task_Intern, null , null, @PathLength_intern, @GenProcIDForAutomated select @RowsFilledIn = @@ROWCOUNT if @RowsFilledIn
33 > 0 begin  exec QBM_PSessionContextSet 'INSERTEDINTODBQUEUE', '1' end  end else  begin                       insert into DialogDBQueue (uid_DialogDBQueue
34, UID_Task, object, SubObject, PathLength, GenProcID) select newid(), @UID_Task_Intern, null , null, @PathLength_intern, @GenProcIDForAutomated select 
35@RowsFilledIn = @@ROWCOUNT if @RowsFilledIn > 0 begin  exec QBM_PSessionContextSet 'INSERTEDINTODBQUEUE', '1' end  end end  if @CountParameter = 1 begin
36 if @IsNoGenProcIDCheck = 0 begin insert into @Compressed (Object, GenProcID) select distinct e.Object as Object, e.GenProcID as GenprocID from @DBQueueElements
37 e where e.Object > ' ' end else begin insert into @Compressed (Object, GenProcID) select e.Object as Object, MAX(e.GenProcID) as GenprocID from @DBQueueElements
38 e where e.Object > ' ' group by e.Object end if @IsNoGenProcIDCheck = 0 begin                          insert into DialogDBQueue (uid_DialogDBQueue, UID_Task
39, object, SubObject, PathLength, GenProcID) select newid(), @UID_Task_Intern, x.Object , null, @PathLength_intern, x.GenProcID from @Compressed x select
40 @RowsFilledIn = @@ROWCOUNT if @RowsFilledIn > 0 begin  exec QBM_PSessionContextSet 'INSERTEDINTODBQUEUE', '1' end  end else  begin                    
41      insert into DialogDBQueue (uid_DialogDBQueue, UID_Task, object, SubObject, PathLength, GenProcID) select newid(), @UID_Task_Intern, x.Object , null
42, @PathLength_intern, x.GenProcID from @Compressed x select @RowsFilledIn = @@ROWCOUNT if @RowsFilledIn > 0 begin  exec QBM_PSessionContextSet 'INSERTEDINTODBQUEUE'
43, '1' end  end end  if @CountParameter = 2 begin if @IsNoGenProcIDCheck = 0 begin insert into @Compressed (Object, SubObject, GenProcID) select distinct
44 e.Object as Object, e.SubObject as SubObject, e.GenProcID as GenprocID from @DBQueueElements e where e.Object > ' ' and e.SubObject > ' ' end else begin
45 insert into @Compressed (Object, SubObject, GenProcID) select e.Object as Object, e.SubObject as SubObject, MAX(e.GenProcID) as GenprocID from @DBQueueElements
46 e where e.Object > ' ' and e.SubObject > ' ' group by e.Object, e.SubObject end if @IsNoGenProcIDCheck = 0 begin                            insert into
47 DialogDBQueue (uid_DialogDBQueue, UID_Task, object, SubObject, PathLength, GenProcID) select newid(), @UID_Task_Intern, x.Object , x.SubObject, @PathLength_intern
48, x.GenProcID from @Compressed x select @RowsFilledIn = @@ROWCOUNT if @RowsFilledIn > 0 begin  exec QBM_PSessionContextSet 'INSERTEDINTODBQUEUE', '1' end
49  end else  begin                            insert into DialogDBQueue (uid_DialogDBQueue, UID_Task, object, SubObject, PathLength, GenProcID) select newid
50(), @UID_Task_Intern, x.Object , x.SubObject, @PathLength_intern, x.GenProcID from @Compressed x select @RowsFilledIn = @@ROWCOUNT if @RowsFilledIn > 0
51 begin  exec QBM_PSessionContextSet 'INSERTEDINTODBQUEUE', '1' end  end end  if @RowsFilledIn > 0 and ( @UID_TaskAutomatedFollower > ' ' or @UID_TaskAutomatedPredecessor
52 > ' ' ) begin if @UID_TaskAutomatedFollower > ' ' begin exec QBM_PDBQueueInsert_Single @UID_TaskAutomatedFollower, '', '', @GenProcIDForAutomated end 
53if @UID_TaskAutomatedPredecessor > ' ' begin exec QBM_PDBQueueInsert_Single @UID_TaskAutomatedPredecessor, '', '', @GenProcIDForAutomated end end  if @DebugSwitch
54 > 0 begin print 'vor dem Catchblock' end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH endLabel: exec
55 QBM_PSessionContextSet 'GenProcID', @GenProcID_R exec QBM_PSessionContextSet 'XUser', @XUser_R if @DebugSwitch > 0 begin exec QBM_PJournal @Debugstarttime
56, @@procid, 'T', @Debuglevel end if @DebugSwitch > 0 begin print 'vor dem Return Bulkinsert' end return end 
57

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.157

inserts DBQueue tasks uses session context values has TRY/CATCH error handling

Summary: calls QBM_PSessionContextSet, QBM_PJournal, QBM_PSessionErrorAdd, QBM_PDBQueueInsert_Single; writes INSERT into, INSERT DialogDBQueue, UPDATE DialogDatabase; reads/joins QBMDBQueueTaskMetric, QBMDBQueueTask, DialogDBQueue, DialogTable; uses config Common\ProcessState; uses session context XUser, GenProcID, INSERTEDINTODBQUEUE

Declared parameters

ParameterTypeDirection
@UID_Taskvarchar(38)input
@DBQueueElementsqbm_ydbqueuerawinput

DML targets

INSERT into INSERT DialogDBQueue UPDATE DialogDatabase

Config/session

Config: Common\ProcessState

Session: XUser GenProcID INSERTEDINTODBQUEUE

DBQueue/tasks

if @UID_Task in ( QBM-K-BaseMigrationReady QBM-K-CommonReCalculate QBM-K-XMarkedForDeletionPush QBM-K-XDateSubItemUpdate QBM-K-XDateSubItemUpdateFU QBM-K-CommonTaskStart

Temp tables / referenced variables

Temp: #LDS #Internal #Invalid

Variables: @UID_Task @DBQueueElements @msg @PathLength_intern @UID_TaskAutomatedFollower @UID_TaskAutomatedPredecessor @IsNoGenProcIDCheck @CountParameter @GenProcID_R @XUser_R @myName @UID_Task_Intern @DebugStarttime @DebugLevel @DebugMessage @DebugSwitch @GenProcIDForAutomated @RowsFilledIn @Compressed @ErrorBuffer @Debugmessage @procid @nestlevel @ROWCOUNT @Debugstarttime @Debuglevel

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 objectRelationEvidence
dbo.QBM_P1B7262FC192C886D0EB9F74_SQL expression dependencyOBJECT_OR_COLUMN
dbo.QBM_P40B0C8AE71E45BA9C883A96_SQL expression dependencyOBJECT_OR_COLUMN
dbo.QBM_PDBQueueInsert_BulkSQL expression dependencyOBJECT_OR_COLUMN
dbo.QBM_P1B7262FC192C886D0EB9F74_source text referenceinserts DBQueue tasks
dbo.QBM_P40B0C8AE71E45BA9C883A96_source text referenceinserts DBQueue tasks, has TRY/CATCH error handling
dbo.QBM_PDBQueueInsert_Bulksource text referenceinserts DBQueue tasks, uses session context values, has TRY/CATCH error handling