dbo.QER_FTHelperHeadOrgChildren
Inline Table FunctionSQL_INLINE_TABLE_VALUED_FUNCTIONSandbox DB
Interpretation
- Database function. Usually supports views, validation, or calculated predicates; look at referenced-by entries for callers.
Relations
- No extracted relations.
Typed Edges
- No typed edges extracted for this source.
Complete Source
1CREATE FUNCTION dbo.QER_FTHelperHeadOrgChildren(2 @UID_PersonHead varchar(38)3) RETURNS TABLE4 WITH schemabinding5AS6RETURN(7SELECT8 DISTINCT b.UID_Org AS UID_Org,9 b.XObjectKey AS XObjectKey10FROM(11SELECT UID_Org12FROM dbo.HelperHeadOrg hho13WHERE14 hho.UID_PersonHead = @UID_PersonHead AND hho.XOrigin > 015UNION all16SELECT UID_Org17FROM dbo.BaseTree18WHERE19 UID_PersonHead = @UID_PersonHead20UNION all21SELECT UID_Org22FROM dbo.BaseTree23WHERE24 UID_PersonHeadSecond = @UID_PersonHead) AS x25JOIN dbo.BaseTreeCollectionF co26 ON x.uid_org = co.UID_ParentOrg27JOIN dbo.BaseTree b28 ON co.UID_Org = b.UID_Org)
Open raw exported source
1create function dbo.QER_FTHelperHeadOrgChildren (@UID_PersonHead varchar(38)) returns table with schemabinding as return( select distinct b.UID_Org as2 UID_Org , b.XObjectKey as XObjectKey from ( select UID_Org from dbo.HelperHeadOrg hho where hho.UID_PersonHead = @UID_PersonHead and hho.XOrigin > 0 3 union all select UID_Org from dbo.BaseTree where UID_PersonHead = @UID_PersonHead union all select UID_Org from dbo.BaseTree where UID_PersonHeadSecond4 = @UID_PersonHead ) as x join dbo.BaseTreeCollectionF co on x.uid_org = co.UID_ParentOrg join dbo.BaseTree b on co.UID_Org = b.UID_Org ) 5