dbo.QER_ZOrgRoot

SQL_STORED_PROCEDURE

Created 2025-06-27T18:01:06.937 · modified 2026-04-14T23:20:39.550 · source: live DB sys.objects/sys.sql_expression_dependencies.

Open formatted source/search result

Parameters

NameTypeOutput
@SlotNumberintno
@UID_OrgRootvarcharno
@dummyvarcharno
@GenProcIDvarcharno

Referenced objects

SchemaObjectColumn/minorClass
BaseTreeOBJECT_OR_COLUMN
BaseTreeCollectionOBJECT_OR_COLUMN
orgrootOBJECT_OR_COLUMN
QBM_PDBQueueCalculateDeltaOBJECT_OR_COLUMN
QBM_PDBQueueInsert_BulkOBJECT_OR_COLUMN
QBM_PFESimulationFillOBJECT_OR_COLUMN
QBM_PSessionErrorAddOBJECT_OR_COLUMN
QBM_YDataForDeltaTYPE
QBM_YDBQueueDeltaHelperTYPE
QBM_YDBQueueRawTYPE
QBM_YTriggerOperationTYPE
dboQBM_FCVElementToObjectKey2OBJECT_OR_COLUMN
dboQBM_FGIIsSimulationModeOBJECT_OR_COLUMN
dboQER_FGIOrgRootNameOBJECT_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 QER_ZOrgRoot ( @SlotNumber int , @UID_OrgRoot varchar(38), @dummy varchar(38) , @GenProcID varchar(38) ) AS begin  declare
2 @IsSimulationMode bit = dbo.QBM_FGIIsSimulationMode() declare @QBMDeltaHelper QBM_YDBQueueDeltaHelper BEGIN TRY declare @topdown bit declare @AnzahlRow
3 int declare @Debugswitch int = 0 declare @Sourcedata QBM_YDataForDelta , @CountDeltaQantity int , @CountDeltaOrigin int    select @topdown = isTopDown
4 from orgroot where uid_orgroot = @UID_OrgRoot if @Debugswitch > 0 begin print 'QER_ZOrgRoot : ' + @uid_Orgroot end  insert into @SourceData( IsUpcommingContent
5, XOriginBefore , Element, AssignedElement, XOriginAfter ) select 0, 2 , co.UID_Org , co.UID_ParentOrg, 0 from BaseTreeCollection co where co.uid_org in
6 (select uid_org from BaseTree where uid_orgroot = @UID_OrgRoot )   insert into @QBMDeltaHelper (Element, AssignedElement, XOrigin) select uid_org, uid_org
7 , 2 from BaseTree where uid_orgroot = @UID_OrgRoot   select @AnzahlRow = 1 while @AnzahlRow > 0 begin if @topdown = 1 begin  insert into @QBMDeltaHelper
8 (Element, AssignedElement, XOrigin) select distinct y.Element, x.UId_parentorg , 2  from BaseTree x, @QBMDeltaHelper y where x.uid_orgroot = @UID_OrgRoot
9 and x.uid_org = y.AssignedElement and x.uid_parentorg > ' ' and not exists (select top 1 1 from @QBMDeltaHelper h where h.Element = y.Element and h.AssignedElement
10 = x.uid_parentorg ) and x.isCutNode = 0 select @AnzahlRow = @@rowcount end else  begin  insert into @QBMDeltaHelper (Element,AssignedElement, XOrigin)
11 select distinct y.Element, x.uid_org , 2  from BaseTree x, @QBMDeltaHelper y where x.uid_orgroot = @UID_OrgRoot and x.uid_parentorg = y.AssignedElement
12  and not exists (select top 1 1 from @QBMDeltaHelper h where h.Element = y.Element and h.AssignedElement = x.uid_org ) and x.isCutNode = 0 select @AnzahlRow
13 = @@rowcount end end   insert into @SourceData( IsUpcommingContent, XOriginBefore, XOriginAfter , Element, AssignedElement ) select 1, 0, 2 , Element,
14 AssignedElement from @QBMDeltaHelper if @Debugswitch > 0 begin select * from @SourceData end exec QBM_PDBQueueCalculateDelta @SourceData, @DeltaQuantity
15 = 1, @DeltaDelete = 0, @DeltaInsert = 0, @DeltaOrigin = 0, @CountDeltaQantity = @CountDeltaQantity output , @CountDeltaOrigin = @CountDeltaOrigin output
16 , @UseIsInEffect = 0 , @SlotNumber = @SlotNumber  if @Debugswitch > 0 begin print '@CountDeltaQantity ' + str(@CountDeltaQantity) end if @CountDeltaQantity
17 > 0 begin   delete from BaseTreeCollection where uid_org in (select uid_org from BaseTree where uid_orgroot = @UID_OrgRoot )  if @IsSimulationMode = 1
18 begin declare @SimulationModeBuffer QBM_YTriggerOperation insert into @SimulationModeBuffer (operation, BaseObjectType, ColumnName, Objectkey, OldValue
19) select 'I', dbo.QER_FGIOrgRootName(b.uid_orgroot)+ 'Collection', '', dbo.QBM_FCVElementToObjectKey2(dbo.QER_FGIOrgRootName(b.uid_orgroot)+ 'Collection'
20, 'uid_' + dbo.QER_FGIOrgRootName(b.uid_orgroot), c.Element, 'uid_Parent' + dbo.QER_FGIOrgRootName(b.uid_orgroot), c.AssignedElement) , ''  from @QBMDeltaHelper
21 c join BaseTree b on c.Element = b.uid_org exec QBM_PFESimulationFill @SimulationModeBuffer end  insert into BaseTreeCollection (uid_org, uid_parentorg
22) select Element, AssignedElement from @QBMDeltaHelper declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, 
23genprocid) select x.uid, null, x.GenProcID from ( select d.Element as uid, @GenProcID as GenProcID  from #QBMDeltaQuantity d ) as x exec QBM_PDBQueueInsert_Bulk
24 'QER-K-AllForOneOrg', @DBQueueElements_01 exec QBM_PDBQueueInsert_Bulk 'QER-K-BaseTreeCollectionF', @DBQueueElements_01 end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd
25 default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende:    truncate table #QBMDeltaDelete return end 
26

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:39.550

inserts DBQueue tasks has TRY/CATCH error handling

Summary: calls QBM_PDBQueueCalculateDelta, QBM_PFESimulationFill, QBM_PDBQueueInsert_Bulk, QBM_PSessionErrorAdd; writes INSERT into, INSERT BaseTreeCollection, DELETE BaseTreeCollection; reads/joins orgroot, BaseTreeCollection, BaseTree

Declared parameters

ParameterTypeDirection
@SlotNumberintinput
@UID_OrgRootvarchar(38)input
@dummyvarchar(38)input
@GenProcIDvarchar(38)input

DML targets

INSERT into INSERT BaseTreeCollection DELETE BaseTreeCollection

Config/session

Config: None extracted.

Session: None extracted.

DBQueue/tasks

QER-K-AllForOneOrg QER-K-BaseTreeCollectionF

Temp tables / referenced variables

Temp: #QBMDeltaQuantity #QBMDeltaDelete

Variables: @SlotNumber @UID_OrgRoot @dummy @GenProcID @IsSimulationMode @QBMDeltaHelper @topdown @AnzahlRow @Debugswitch @Sourcedata @CountDeltaQantity @CountDeltaOrigin @uid_Orgroot @SourceData @rowcount @DeltaQuantity @DeltaDelete @DeltaInsert @DeltaOrigin @UseIsInEffect @SimulationModeBuffer @DBQueueElements_01

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.