dbo.QER_PIsForITShopFlagCheck
SQL_STORED_PROCEDURE
Created 2025-06-27T17:59:27.267 · modified 2026-04-14T23:20:36.240 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
@TableName | varchar | no |
@ElementsToCheck | QBM_YParameterList | no |
@ChildrenToCheck | varchar | no |
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| BaseTree | OBJECT_OR_COLUMN | ||
| BaseTreeAssign | OBJECT_OR_COLUMN | ||
| BaseTreeHasESet | OBJECT_OR_COLUMN | ||
| DialogTable | OBJECT_OR_COLUMN | ||
| ESet | OBJECT_OR_COLUMN | ||
| ESetHasEntitlement | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| QBM_VQBMRelation | OBJECT_OR_COLUMN | ||
| QBM_YCursorBuffer | TYPE | ||
| QBM_YParameterList | TYPE | ||
| dbo | QBM_FCVStringToBit | OBJECT_OR_COLUMN | |
| dbo | QBM_FCVStringToList | 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 QER_PIsForITShopFlagCheck (@TableName varchar(30) , @ElementsToCheck QBM_YParameterList readOnly , @ChildrenToCheck 2 varchar(max) = '' ) as begin declare @BasetreeMN varchar(30) declare @BasetreeMNPK varchar(30) declare @TableMN varchar(30) declare @TableMNPK varchar 3(30) declare @ElementBuffer QBM_YCursorBuffer declare @ElementCount int declare @ElementIndex int declare @DebugSwitch int = 0 declare @SQLCmd nvarchar 4(max) declare @Message nvarchar(max) declare @PatternBaseTreeAus nvarchar(max) = ' 5 declare @erg int 6 select top 1 @erg = 1 7 from #ITShopFlags i join @BasetreeMN bha on i.UID_PK = bha.@BasetreeMNPK 8 and bha.XOrigin > 0 9 --and ohg.XIsInEffect = 1 10 join BaseTree b on bha.uid_org = b.uid_Org 11 where i.IsForITShopNew = 0 12 and i.IsITShopOnlyNew = 0 13 and (b.XObjectKey like ''<Key><T>ITShop___</T>%'' 14 or b.XObjectKey like ''<Key><T>MirrorShop</T>%'' 15 ) 16' 17 declare @PatternBasetreeAn nvarchar(max) = ' 18 declare @erg int 19 select top 1 @erg = 1 20 from #ITShopFlags i join @BasetreeMN bha on i.UID_PK = bha.@BasetreeMNPK 21 and bha.XOrigin > 0 22 --and ohg.XIsInEffect = 1 23 join BaseTree b on bha.uid_Org = b.UId_Org 24 where i.IsForITShopNew = 1 25 and i.IsITShopOnlyNew = 1 26 and not (b.XObjectKey like ''<Key><T>ITShop___</T>%'' 27 or b.XObjectKey like ''<Key><T>MirrorShop</T>%'' 28 ) 29' 30 declare @PatternAddOnChildren nvarchar(max) = ' 31 declare @erg int 32 select top 1 @erg = 1 33 from #ITShopFlags i join @TableMN zuw on i.UID_PK = zuw.@TableMNPK 34 and zuw.XOrigin & 0xFFFFFFFD /*dbo.QBM_F G I BitPatternXOrigin(''|Inherit|'', 1)*/ > 0 35 -- ohne XIsInEffect-Test, könnte ja jederzeit wieder angehen 36 where IsForITShopNew = 1 37 and i.IsITShopOnlyNew = 1 38' 39 SET XACT_ABORT OFF BEGIN TRY drop table if exists #ITShopFlags create table #ITShopFlags (IsForITShopNew bit , IsITShopOnlyNew bit , UID_PK varchar(38 40) collate database_default , XObjectKey varchar(138) collate database_default ) insert into #ITShopFlags(UID_PK, XObjectKey, IsForITShopNew, IsITShopOnlyNew 41) select e.Parameter1, e.Parameter2, e.HasContentFull, dbo.QBM_FCVStringToBit(e.Parameter3) from @ElementsToCheck e if @debugswitch > 0 begin select * 42from #ITShopFlags end select @BasetreeMN = tba.TableName , @BasetreeMNPK = r.ChildColumn from BaseTreeAssign a join DialogTable tba with (readpast) on 43 a.UID_DialogTableMN = tba.UID_DialogTable join DialogTable tb with (readpast) on a.UID_DialogTableElement = tb.UID_DialogTable join QBM_VQBMRelation r 44 on r.ChildTable = tba.TableName and r.ParentTable = @Tablename where tb.TableName = @Tablename if @DebugSwitch > 0 begin print @BasetreeMN print @BasetreeMNPK 45 end insert into @ElementBuffer(Ident1, Ident2) select rp.ChildTable, rp.ChildColumn from BaseTreeAssign a join DialogTable tba with (readpast) on a.UID_DialogTableMN 46 = tba.UID_DialogTable join DialogTable tb with (readpast) on a.UID_DialogTableElement = tb.UID_DialogTable join QBM_VQBMRelation r on r.ChildTable = tba.TableName 47 and r.ParentTable = @Tablename join QBM_VQBMRelation rp on rp.ParentTable = @Tablename and a.UID_TaskPerson > ' ' and rp.IsMNRelation = 1 join QBM_VQBMRelation 48 rph on rp.UID_QBMRelationMN = rph.UID_QBMRelation and rph.ParentTable = 'Person' where tb.TableName = @Tablename union select rp.ChildTable , rp.ChildColumn 49 from BaseTreeAssign a join DialogTable tba with (readpast) on a.UID_DialogTableMN = tba.UID_DialogTable join DialogTable tb with (readpast) on a.UID_DialogTableElement 50 = tb.UID_DialogTable join QBM_VQBMRelation r on r.ChildTable = tba.TableName and r.ParentTable = @Tablename join QBM_VQBMRelation rp on rp.ParentTable 51 = @Tablename and a.UID_TaskWorkDesk > ' ' and rp.IsMNRelation = 1 join QBM_VQBMRelation rph on rp.UID_QBMRelationMN = rph.UID_QBMRelation and rph.ParentTable 52 = 'WorkDesk' where tb.TableName = @Tablename union select rp.ChildTable, rp.ChildColumn from BaseTreeAssign a join DialogTable tba with (readpast) on 53a.UID_DialogTableMN = tba.UID_DialogTable join DialogTable tb with (readpast) on a.UID_DialogTableElement = tb.UID_DialogTable join QBM_VQBMRelation r 54on r.ChildTable = tba.TableName and r.ParentTable = @Tablename join QBM_VQBMRelation rp on rp.ParentTable = @Tablename and a.UID_TaskHardware > ' ' and 55 rp.IsMNRelation = 1 join QBM_VQBMRelation rph on rp.UID_QBMRelationMN = rph.UID_QBMRelation and rph.ParentTable = 'Hardware' where tb.TableName = @Tablename 56 union select r.ChildTable, r.ChildColumn from QBM_VQBMRelation r join dbo.QBM_FCVStringToList(@ChildrenToCheck, '|', 1,0) as c on r.ChildTable = c.ParameterValue 57 where r.ParentTable = @Tablename and r.IsMNRelation = 1 select @ElementCount = @@ROWCOUNT if @DebugSwitch > 0 begin select e.Ident1, e.Ident2 from @ElementBuffer 58 e end if exists( select top 1 1 from #ITShopFlags i where i.IsForITShopNew = 0 and i.IsITShopOnlyNew = 1 ) begin raiserror( '#LDS#Invalid flag combination for IsForITShop and IsITShopOnly.|' 59, 18, 2) with nowait end select @SQLCmd = replace(replace(@PatternBaseTreeAus , '@BasetreeMNPK', @BasetreeMNPK) , '@BasetreeMN', @BasetreeMN) if @DebugSwitch 60 > 0 begin print @SQLCmd end exec sp_executesql @SQLCMd if @@ROWCOUNT > 0 begin raiserror( '#LDS#Changes cannot take place, because assignments still exist within IT Shop structures.|' 61, 18, 2) with nowait end if not exists(select top 1 1 from #ITShopFlags i where i.IsForITShopNew = 1 and i.IsITShopOnlyNew = 1 ) begin goto endLabel 62 end select @SQLCmd = replace(replace(@PatternBasetreeAn , '@BasetreeMNPK', @BasetreeMNPK) , '@BasetreeMN', @BasetreeMN) if @DebugSwitch > 0 begin print 63 @SQLCmd end exec sp_executesql @SQLCMd if @@ROWCOUNT > 0 begin raiserror( '#LDS#Changes cannot take place, because assignments still exist outside IT Shop structures.|' 64, 18, 2) with nowait end select @ElementIndex = 1 while @ElementIndex <= @ElementCount begin select top 1 @TableMN = bu.Ident1 , @TableMNPK = 65 bu.Ident2 from @ElementBuffer bu where bu.ElementIndex = @ElementIndex select @SQLCmd = replace(replace(@PatternAddOnChildren , '@TableMNPK', @TableMNPK 66) , '@TableMN', @TableMN) if @DebugSwitch > 0 begin print @SQLCmd end exec sp_executesql @SQLCMd if @@ROWCOUNT > 0 begin select @Message = '#LDS#Changes cannot take place because direct assignments still exist. Table: {0}.|' 67 + @TableMNPK + '|' raiserror( @message, 18, 2) with nowait end select @ElementIndex += 1 end if exists (select top 1 1 from #ITShopFlags i join ESetHasEntitlement 68 rhr on rhr.Entitlement = i.XObjectKey and rhr.XOrigin > 0 join BaseTreeHasESet ohs on ohs.XOrigin > 0 and ohs.XIsInEffect = 1 and ohs.uid_ESet = rhr.uid_ESet 69 join BaseTree o on o.uid_org = ohs.uid_org where o.UID_OrgRoot not in ('QER-V-ITShopOrg', 'QER-V-ITShopSrc') and i.IsITShopOnlyNew = 1 ) begin raiserror 70( '#LDS#Change cannot take place because the resource belongs to a package which is assigned to a base tree outside the IT Shop.|', 18, 2) with nowait 71end if exists (select top 1 1 from #ITShopFlags i join ESetHasEntitlement ehe on i.XObjectKey = ehe.Entitlement and ehe.XOrigin > 0 join ESet e on 72ehe.uid_ESet = e.uid_Eset and e.IsITShopOnly = 0 where i.IsForITShopNew = 1 and i.IsITShopOnlyNew = 1 ) begin raiserror( '#LDS#Changes cannot take place, because assignments to system roles still exist that may not be used exclusively in IT Shop.|' 73, 18, 2) with nowait end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() set XACT_ABORT 74 ON RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH endLabel: truncate table #ITShopFlags return end 75
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:36.240
has TRY/CATCH error handling
Summary: calls QBM_PSessionErrorAdd; writes INSERT into; reads/joins BaseTree, BaseTreeAssign, DialogTable, QBM_VQBMRelation, QBM_FCVStringToList…
Declared parameters
| Parameter | Type | Direction |
|---|---|---|
@TableName | varchar(30) | input |
@ElementsToCheck | qbm_yparameterlist | input |
@ChildrenToCheck | varchar | input |
DML targets
INSERT intoCalled routines
Read/join references
SQL dependency metadata
Config/session
Config: None extracted.
Session: None extracted.
DBQueue/tasks
None extracted.Temp tables / referenced variables
Temp: #ITShopFlags #LDS #Invalid #Changes #Change
Variables: @TableName @ElementsToCheck @ChildrenToCheck @BasetreeMN @BasetreeMNPK @TableMN @TableMNPK @ElementBuffer @ElementCount @ElementIndex @DebugSwitch @SQLCmd @Message @PatternBaseTreeAus @erg @PatternBasetreeAn @PatternAddOnChildren @debugswitch @Tablename @ROWCOUNT @SQLCMd @message @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.ADS_TUAdsGroup | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.LDP_TULDAPGroup | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_TUQERAssign | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_TUQERResource | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_TUQERReuse | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_TUQERReuseUS | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.RMS_TUESet | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.RPS_TURPSReport | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.TSB_TUTSBAccountDef | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.TSB_TUUNSGroupB | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.TSB_TUUNSGroupB1 | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.TSB_TUUNSGroupB2 | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.TSB_TUUNSGroupB3 | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.ADS_TUAdsGroup | source text reference | creates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.LDP_TULDAPGroup | source text reference | creates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.QER_TUQERAssign | source text reference | creates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.QER_TUQERResource | source text reference | creates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.QER_TUQERReuse | source text reference | creates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.QER_TUQERReuseUS | source text reference | creates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.RMS_TUESet | source text reference | creates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.RPS_TURPSReport | source text reference | creates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.TSB_TUTSBAccountDef | source text reference | creates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.TSB_TUUNSGroupB | source text reference | creates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.TSB_TUUNSGroupB1 | source text reference | creates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.TSB_TUUNSGroupB2 | source text reference | creates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.TSB_TUUNSGroupB3 | source text reference | creates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |