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.

Open formatted source/search result

Parameters

NameTypeOutput
@TableNamevarcharno
@ElementsToCheckQBM_YParameterListno
@ChildrenToCheckvarcharno

Referenced objects

SchemaObjectColumn/minorClass
BaseTreeOBJECT_OR_COLUMN
BaseTreeAssignOBJECT_OR_COLUMN
BaseTreeHasESetOBJECT_OR_COLUMN
DialogTableOBJECT_OR_COLUMN
ESetOBJECT_OR_COLUMN
ESetHasEntitlementOBJECT_OR_COLUMN
QBM_PSessionErrorAddOBJECT_OR_COLUMN
QBM_VQBMRelationOBJECT_OR_COLUMN
QBM_YCursorBufferTYPE
QBM_YParameterListTYPE
dboQBM_FCVStringToBitOBJECT_OR_COLUMN
dboQBM_FCVStringToListOBJECT_OR_COLUMN
dboQBM_FGISessionErrorRethrowOBJECT_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_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

ParameterTypeDirection
@TableNamevarchar(30)input
@ElementsToCheckqbm_yparameterlistinput
@ChildrenToCheckvarcharinput

DML targets

INSERT into

Called routines

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 objectRelationEvidence
dbo.ADS_TUAdsGroupSQL expression dependencyOBJECT_OR_COLUMN
dbo.LDP_TULDAPGroupSQL expression dependencyOBJECT_OR_COLUMN
dbo.QER_TUQERAssignSQL expression dependencyOBJECT_OR_COLUMN
dbo.QER_TUQERResourceSQL expression dependencyOBJECT_OR_COLUMN
dbo.QER_TUQERReuseSQL expression dependencyOBJECT_OR_COLUMN
dbo.QER_TUQERReuseUSSQL expression dependencyOBJECT_OR_COLUMN
dbo.RMS_TUESetSQL expression dependencyOBJECT_OR_COLUMN
dbo.RPS_TURPSReportSQL expression dependencyOBJECT_OR_COLUMN
dbo.TSB_TUTSBAccountDefSQL expression dependencyOBJECT_OR_COLUMN
dbo.TSB_TUUNSGroupBSQL expression dependencyOBJECT_OR_COLUMN
dbo.TSB_TUUNSGroupB1SQL expression dependencyOBJECT_OR_COLUMN
dbo.TSB_TUUNSGroupB2SQL expression dependencyOBJECT_OR_COLUMN
dbo.TSB_TUUNSGroupB3SQL expression dependencyOBJECT_OR_COLUMN
dbo.ADS_TUAdsGroupsource text referencecreates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling
dbo.LDP_TULDAPGroupsource text referencecreates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling
dbo.QER_TUQERAssignsource text referencecreates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling
dbo.QER_TUQERResourcesource text referencecreates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling
dbo.QER_TUQERReusesource text referencecreates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling
dbo.QER_TUQERReuseUSsource text referencecreates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling
dbo.RMS_TUESetsource text referencecreates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling
dbo.RPS_TURPSReportsource text referencecreates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling
dbo.TSB_TUTSBAccountDefsource text referencecreates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling
dbo.TSB_TUUNSGroupBsource text referencecreates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling
dbo.TSB_TUUNSGroupB1source text referencecreates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling
dbo.TSB_TUUNSGroupB2source text referencecreates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling
dbo.TSB_TUUNSGroupB3source text referencecreates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling