dbo.QER_FTEntitlementSourceOrg
SQL_TABLE_VALUED_FUNCTION
Created 2026-04-14T23:20:35.780 · modified 2026-04-14T23:20:35.780 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
@ObjectKeyToInspect | varchar | no |
@uid_Org | varchar | no |
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| BaseTree | OBJECT_OR_COLUMN | ||
| helperPersonOrg | OBJECT_OR_COLUMN | ||
| Orgroot | OBJECT_OR_COLUMN | ||
| personinBaseTree | OBJECT_OR_COLUMN | ||
| QBM_YMNTable | TYPE | ||
| QBM_YSingleGUID | TYPE | ||
| QER_VBaseTreeCollection_Root | OBJECT_OR_COLUMN | ||
| dbo | QER_FTEntitlementSourceWho | OBJECT_OR_COLUMN |
Source excerpt
First extracted SQL definition lines from the exported source. Use the full source page for complete context.
1create function dbo.QER_FTEntitlementSourceOrg ( @ObjectKeyToInspect varchar(138) , @uid_Org varchar(38) ) returns @result table (UID_Org varchar(38 2) collate database_default , UID_ParentOrg varchar(38) collate database_default , Ident_Org nvarchar(256) collate database_default , AssignType int 3 , ObjectKeyOrg varchar(138) collate database_default ) as begin declare @erg QBM_YSingleGUID declare @Person QBM_YSingleGUID declare @QER_VBaseTreeCollection_Root 4 QBM_YMNTable insert into @person(UID_SingleGuid ) select w.UID_Person from dbo.QER_FTEntitlementSourceWho(@ObjectKeyToInspect ) w group by w.UID_Person 5 insert into @QER_VBaseTreeCollection_Root(UID_Element1 , UID_Element2 ) select v.UID_Org, v.UID_ParentOrg from QER_VBaseTreeCollection_Root v where v.UID_ParentOrg 6 = @uid_org insert into @QER_VBaseTreeCollection_Root(UID_Element1 , UID_Element2 ) select distinct v.UID_Org, v.UID_ParentOrg from @QER_VBaseTreeCollection_Root 7 e join QER_VBaseTreeCollection_Root v on e.UID_Element1 = v.UID_Org join QER_VBaseTreeCollection_Root v2 on v.UID_ParentOrg = v2.UID_Org and e.UID_Element2 8 = v2.UID_ParentOrg where not exists (select top 1 1 from @QER_VBaseTreeCollection_Root x where x.UID_Element1 = v.UID_Org and x.UID_Element2 = v.UID_ParentOrg 9 ) insert into @erg (UID_SingleGuid , IntProperty ) select co.UID_Element1 , sign(max(sign(len(isnull(x.uid_org, '')))) ) from @QER_VBaseTreeCollection_Root 10 co left outer join ( select pio.uid_org from personinBaseTree pio join @Person p on pio.uid_person = p.UID_SingleGuid and pio.XOrigin > 0 union select 11 pio.uid_org from helperPersonOrg pio join @Person p on pio.uid_person = p.UID_SingleGuid ) as x on co.UID_Element1 = x.uid_org group by co.UID_Element1 12 update @erg set IntProperty += 2 from @erg e join @QER_VBaseTreeCollection_Root co on co.UID_Element2 = e.UID_SingleGuid where exists (select top 13 1 1 from @erg e2 where e2.UID_SingleGuid = co.UID_Element1 and e2.IntProperty = 1 and e2.UID_SingleGuid <> e.UID_SingleGuid ) insert into @result 14 (uid_org, uid_parentorg, ident_org, assigntype, ObjectkeyOrg ) select e.UID_SingleGuid , b.uid_parentorg, b.ident_org, e.IntProperty , b.XObjectKey from 15 @erg e left outer join BaseTree b on e.UID_SingleGuid = b.uid_org update @result set ident_org = r.ident_orgroot, ObjectKeyOrg = r.XObjectKey from @result 16 rx , Orgroot r where rx.uid_org = r.uid_orgroot if @@rowcount > 0 begin update @result set uid_parentorg = b.uid_orgroot from @result rx, BaseTree b where 17 rx.uid_parentorg is null and rx.uid_org = b.uid_org end ende: return end 18
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:35.780
None extracted.
Summary: writes INSERT into; reads/joins QER_FTEntitlementSourceWho, QER_VBaseTreeCollection_Root, personinBaseTree, helperPersonOrg, BaseTree
Declared parameters
| Parameter | Type | Direction |
|---|---|---|
@ObjectKeyToInspect | varchar(138) | input |
@uid_Org | varchar(38) | input |
DML targets
INSERT intoCalled routines
None extracted.
Read/join references
SQL dependency metadata
Config/session
Config: None extracted.
Session: None extracted.
DBQueue/tasks
None extracted.Temp tables / referenced variables
Temp: None extracted.
Variables: @ObjectKeyToInspect @uid_Org @result @erg @Person @QER_VBaseTreeCollection_Root @person @uid_org @rowcount
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.