dbo.QER_PITShop_ShopMove
SQL_STORED_PROCEDURE
Created 2025-06-27T18:01:06.767 · modified 2026-04-14T23:20:39.303 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
@UID_OrgSHSource | varchar | no |
@UID_OrgSCTarget | varchar | no |
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| Basetree | OBJECT_OR_COLUMN | ||
| DynamicGroup | OBJECT_OR_COLUMN | ||
| ITShopOrgHasPWODecisionMethod | OBJECT_OR_COLUMN | ||
| PersonInBaseTree | OBJECT_OR_COLUMN | ||
| PersonInITShopOrg | OBJECT_OR_COLUMN | ||
| QBM_PJobCreate_HOTemplate_B | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| QBM_YCursorBuffer | TYPE | ||
| QER_PITShop_BoardMove | OBJECT_OR_COLUMN | ||
| dbo | QBM_FCVElementToObjectKey1 | OBJECT_OR_COLUMN | |
| dbo | QBM_FCVElementToObjectKey2 | OBJECT_OR_COLUMN | |
| dbo | QBM_FGIGuidIsValid | OBJECT_OR_COLUMN | |
| dbo | QBM_FGISessionContext | 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_PITShop_ShopMove (@UID_OrgSHSource varchar(38) , @UID_OrgSCTarget varchar(38) ) as begin declare @uid_orgCU_Source varchar 2(38) declare @UID_OrgSC_Source varchar(38) declare @UID_OrgSH_Target varchar(38) declare @UID_OrgCU_Target varchar(38) declare @UID_DynamicGroup_Source 3 varchar(38) declare @UID_DynamicGroup_Target varchar(38) declare @countCustomer_Source int declare @WhereClause nvarchar(max) declare @startat datetime 4 declare @ElementBuffer QBM_YCursorBuffer declare @ElementCount int declare @ElementIndex int declare @UID_OrgBOSource varchar(38) declare @GenProcID varchar 5(38) declare @XUser nvarchar(64) = object_name(@@procid) declare @Xdate datetime = getutcdate() declare @FullPathSCTarget nvarchar(400) SET XACT_ABORT 6OFF BEGIN TRY select @GenProcID = dbo.QBM_FGISessionContext('') select @uid_orgCU_Source = null select top 1 @uid_orgCU_Source = cu.uid_org , @UID_OrgSC_Source 7 = sc.uid_org from Basetree sh join BaseTree cu on cu.uid_parentorg = sh.UID_Org and cu.itShopInfo = 'CU' left outer join Basetree sc on sh.UID_ParentOrg 8 = sc.uid_org where sh.uid_org = @UID_OrgSHSource and sh.uid_OrgRoot = 'QER-V-ITShopOrg' and sh.ITShopInfo = 'SH' if @uid_orgCU_Source is null begin raiserror 9( '#LDS#The customer node cannot be found in shop (source).|', 18, 2) with nowait end if not exists (select top 1 1 from BaseTree where uid_OrgRoot = 10'QER-V-ITShopOrg' and ITShopInfo = 'SC' and uid_Org = @UID_OrgSCTarget ) begin raiserror( '#LDS#The given target node is not a shopping center.|', 18, 11 2) with nowait end if isnull(@UID_OrgSC_Source, '') = @UID_OrgSCTarget begin goto ende end if not exists (select top 1 1 from BaseTree where uid_OrgRoot 12 = 'QER-V-ITShopOrg' and ITShopInfo = 'SH' and uid_Org = @UID_OrgSHSource and dbo.QBM_FGIGuidIsValid(uid_Org) & 2 = 0 ) begin raiserror( '#LDS#The given shop (source) must not be moved to another shoping center.|' 13, 18, 2) with nowait end if exists (select top 1 1 from BaseTree targetSH where targetSH.uid_OrgRoot = 'QER-V-ITShopOrg' and targetSH.ITShopInfo = 'SH' 14 and targetSH.uid_ParentOrg = @UID_OrgSCTarget and targetSH.Ident_Org in (select Ident_Org from Basetree where uid_org = @UID_OrgSHSource) ) begin raiserror 15( '#LDS#The target shopping center already contains a shop with the same ident.|', 18, 2) with nowait end select top 1 @FullPathSCTarget = fullpath from 16 Basetree where UID_Org = @UID_OrgSCTarget select @UID_OrgSH_Target = newid() insert into BaseTree( UID_Org, UID_ParentOrg, Ident_Org , IsCutNode, Description 17 , uid_OrgRoot , UID_PersonHead, UID_PersonHeadSecond, UID_OrgDepartment, UID_OrgLocality, UID_OrgProfitCenter, UID_OrgAttestator , XDateInserted , XDateUpdated 18 , XUserInserted , XUserUpdated, InternalName , FullPath ,Commentary , ITShopInfo , XObjectKey , IsInvalidForDynamicGroup , UID_PWODecisionMethod ) select 19 @UID_OrgSH_Target, @UID_OrgSCTarget, b.Ident_Org, 0, b.Description, b.UID_OrgRoot , b.UID_PersonHead, b.UID_PersonHeadSecond, b.UID_OrgDepartment, b.UID_OrgLocality 20, b.UID_OrgProfitCenter, b.UID_OrgAttestator , GetUTCDate(), GetUTCDate(), 'QER_PITShopShopMove', 'QER_PITShopShopMove', b.InternalName, concat(@FullPathSCTarget 21, '\', b.Ident_Org), b.Commentary , 'SH', dbo.QBM_FCVElementToObjectKey1('ITShopOrg', 'UID_ITShopOrg', @UID_OrgSH_Target) , 1 , b.UID_PWODecisionMethod 22 from Basetree b where b.uid_org = @UID_OrgSHSource select @UID_OrgCU_Target = newid() insert into BaseTree( UID_Org, UID_ParentOrg, Ident_Org 23 , IsCutNode, Description , uid_OrgRoot , UID_PersonHead, UID_PersonHeadSecond, UID_OrgDepartment, UID_OrgLocality, UID_OrgProfitCenter, UID_OrgAttestator 24 , XDateInserted , XDateUpdated , XUserInserted , XUserUpdated, InternalName , FullPath ,Commentary , ITShopInfo , XObjectKey , IsInvalidForDynamicGroup 25 ) select @UID_OrgCU_Target, @UID_OrgSH_Target, b.Ident_Org, 0, b.Description, b.UID_OrgRoot , b.UID_PersonHead, b.UID_PersonHeadSecond, b.UID_OrgDepartment 26, b.UID_OrgLocality, b.UID_OrgProfitCenter, b.UID_OrgAttestator , GetUTCDate(), GetUTCDate(), 'QER_PITShopShopMove', 'QER_PITShopShopMove', b.InternalName 27, concat(@FullPathSCTarget, '\\', b.Ident_Org), b.Commentary , 'CU', dbo.QBM_FCVElementToObjectKey1('ITShopOrg', 'UID_ITShopOrg', @UID_OrgCU_Target) , 280 from Basetree b where b.uid_org = @uid_orgCU_Source select @WhereClause = 'UID_ITShopOrg = ''' + @UID_OrgCU_Target + '''' select @startat = dateadd(mi 29, -5, GetUTCDate()) exec QBM_PJobCreate_HOTemplate_B 'ITShopOrg', @WhereClause, 'FullPath' , @GenProcID , @AdditionalObjectKeysAffected = default , @priority 30 = 10 , @startat = @startat insert into ITShopOrgHasPWODecisionMethod (UID_ITShopOrg, UID_PWODecisionMethod , XObjectkey , XDateInserted, XDateUpdated 31, XUserInserted, XUserUpdated ) select @UID_OrgSH_Target, o.UID_PWODecisionMethod , dbo.QBM_FCVElementToObjectKey2('ITShopOrgHasPWODecisionMethod', 'UID_ITShopOrg' 32, @UID_OrgSH_Target, 'UID_PWODecisionMethod', o.UID_PWODecisionMethod) , GetUTCDate(), GetUTCDate(), 'QER_PITShopShopMove', 'QER_PITShopShopMove' from 33ITShopOrgHasPWODecisionMethod o where o.UID_ITShopOrg = @UID_OrgSHSource insert into PersonInITShopOrg (UID_Person, UID_ITShopOrg , XOrigin, XObjectkey 34 , XDateInserted, XDateUpdated, XUserInserted, XUserUpdated ) select o.UID_Person, @UID_OrgCU_Target , 1, dbo.QBM_FCVElementToObjectKey2('PersonInITShopOrg' 35, 'UID_ITShopOrg', @UID_OrgCU_Target, 'UID_Person', o.UID_Person) , GetUTCDate(), GetUTCDate(), 'QER_PITShopShopMove', 'QER_PITShopShopMove' from PersonInITShopOrg 36 o where o.UID_ITShopOrg = @uid_orgCU_Source and o.XOrigin & 1 > 0 select @UID_DynamicGroup_Source = null select @UID_DynamicGroup_Target = null select 37 top 1 @UID_DynamicGroup_Source = UID_DynamicGroup from DynamicGroup where ObjectKeyBaseTree = dbo.QBM_FCVElementToObjectKey1('ITShopOrg', 'UID_ITShopOrg' 38, @uid_orgCU_Source) and UID_DialogTableObjectClass = 'QER-T-Person' if @UID_DynamicGroup_Source is not null begin select @UID_DynamicGroup_Target = newid 39() insert into DynamicGroup (UID_DynamicGroup, UID_DialogTableObjectClass, UID_DialogSchedule , ObjectKeyBaseTree , DisplayName, Description , WhereClause 40, WhereClauseAddOn , XObjectkey , XDateInserted, XDateUpdated, XUserInserted, XUserUpdated ) select @UID_DynamicGroup_Target, o.UID_DialogTableObjectClass 41, o.UID_DialogSchedule , dbo.QBM_FCVElementToObjectKey1('ITShopOrg', 'UID_ITShopOrg', @uid_orgCU_Target) , o.DisplayName, o.Description , o.WhereClause 42, o.WhereClauseAddOn , dbo.QBM_FCVElementToObjectKey1('DynamicGroup', 'UID_DynamicGroup', @UID_DynamicGroup_Target) , GetUTCDate(), GetUTCDate(), 'QER_PITShopShopMove' 43, 'QER_PITShopShopMove' from DynamicGroup o where o.UID_DynamicGroup = @UID_DynamicGroup_Source end insert into @ElementBuffer (UID1) select bo.UID_Org 44 from basetree bo join basetree sh on bo.UID_ParentOrg = sh.UID_Org where bo.ITShopInfo = 'BO' and bo.UID_OrgRoot = 'QER-V-ITShopOrg' and sh.UID_Org = 45@UID_OrgSHSource select @ElementCount = @@ROWCOUNT select @ElementIndex = 1 while @ElementIndex <= @ElementCount begin select top 1 @UID_OrgBOSource = 46bu.UID1 from @ElementBuffer bu where bu.ElementIndex = @ElementIndex exec QER_PITShop_BoardMove @UID_OrgBOSource, @UID_OrgSH_Target select @ElementIndex 47 += 1 end delete DynamicGroup where UID_DynamicGroup = @UID_DynamicGroup_Source update PersonInBaseTree set XOrigin = 0 , XDateUpdated = @Xdate 48 , XUserUpdated = @XUser where UID_Org = @uid_orgCU_Source delete PersonInBaseTree where UID_Org = @uid_orgCU_Source delete BaseTree where UID_Org = @uid_orgCU_Source 49 delete BaseTree where UID_Org = @UID_OrgSHSource END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow 50() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH ende: return end 51
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.303
creates object-layer jobs via QBM_PJobCreate* uses session context values has TRY/CATCH error handling
Summary: calls QBM_PJobCreate_HOTemplate_B, QER_PITShop_BoardMove, QBM_PSessionErrorAdd; writes INSERT BaseTree, INSERT ITShopOrgHasPWODecisionMethod, INSERT PersonInITShopOrg, INSERT DynamicGroup, INSERT into…; reads/joins Basetree, BaseTree, ITShopOrgHasPWODecisionMethod, PersonInITShopOrg, DynamicGroup…
Declared parameters
| Parameter | Type | Direction |
|---|---|---|
@UID_OrgSHSource | varchar(38) | input |
@UID_OrgSCTarget | varchar(38) | input |
DML targets
INSERT BaseTree INSERT ITShopOrgHasPWODecisionMethod INSERT PersonInITShopOrg INSERT DynamicGroup INSERT into UPDATE PersonInBaseTree DELETE DynamicGroup DELETE PersonInBaseTree DELETE BaseTreeRead/join references
SQL dependency metadata
- Basetree
- DynamicGroup
- ITShopOrgHasPWODecisionMethod
- PersonInBaseTree
- PersonInITShopOrg
- QBM_PJobCreate_HOTemplate_B
- QBM_PSessionErrorAdd
- QBM_YCursorBuffer
- QER_PITShop_BoardMove
- dbo.QBM_FCVElementToObjectKey1
- dbo.QBM_FCVElementToObjectKey2
- dbo.QBM_FGIGuidIsValid
- dbo.QBM_FGISessionContext
- dbo.QBM_FGISessionErrorRethrow
Config/session
Config: None extracted.
Session: None extracted.
DBQueue/tasks
None extracted.Temp tables / referenced variables
Temp: #LDS #The
Variables: @UID_OrgSHSource @UID_OrgSCTarget @uid_orgCU_Source @UID_OrgSC_Source @UID_OrgSH_Target @UID_OrgCU_Target @UID_DynamicGroup_Source @UID_DynamicGroup_Target @countCustomer_Source @WhereClause @startat @ElementBuffer @ElementCount @ElementIndex @UID_OrgBOSource @GenProcID @XUser @procid @Xdate @FullPathSCTarget @AdditionalObjectKeysAffected @priority @uid_orgCU_Target @ROWCOUNT @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.
No reverse dependencies extracted.