dbo.QER_FTHelperHeadOrgChildren_RT
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
- references source dbo.QER_FTHelperHeadOrgChildren source text reference
Complete Source
1CREATE FUNCTION dbo.QER_FTHelperHeadOrgChildren_RT(2 @UID_PersonHead varchar(38),3 @UID_OrgRoot varchar(38)4) RETURNS TABLE5 WITH schemabinding6AS7RETURN(8SELECT9 DISTINCT b.UID_Org AS UID_Org,10 b.XObjectKey AS XObjectKey11FROM(12SELECT hho.UID_Org13FROM dbo.HelperHeadOrg hho14JOIN dbo.BaseTree b15 ON hho.UID_Org = b.UID_Org AND b.UID_OrgRoot = @UID_OrgRoot16WHERE17 hho.UID_PersonHead = @UID_PersonHead AND hho.XOrigin > 018UNION all19SELECT b.UID_Org20FROM dbo.BaseTree b21WHERE22 b.UID_PersonHead = @UID_PersonHead AND b.UID_OrgRoot = @UID_OrgRoot23UNION all24SELECT b.UID_Org25FROM dbo.BaseTree b26WHERE27 b.UID_PersonHeadSecond = @UID_PersonHead AND b.UID_OrgRoot = @UID_OrgRoot) AS x28JOIN dbo.BasetreeCollectionF co29 ON x.UID_Org = co.UID_ParentOrg30JOIN dbo.BaseTree b31 ON co.UID_Org = b.UID_Org)
Open raw exported source
1create function dbo.QER_FTHelperHeadOrgChildren_RT (@UID_PersonHead varchar(38) , @UID_OrgRoot varchar(38) ) returns table with schemabinding as return2( select distinct b.UID_Org as UID_Org , b.XObjectKey as XObjectKey from ( select hho.UID_Org from dbo.HelperHeadOrg hho join dbo.BaseTree b on hho.UID_Org3 = b.UID_Org and b.UID_OrgRoot = @UID_OrgRoot where hho.UID_PersonHead = @UID_PersonHead and hho.XOrigin > 0 union all select b.UID_Org from dbo.BaseTree4 b where b.UID_PersonHead = @UID_PersonHead and b.UID_OrgRoot = @UID_OrgRoot union all select b.UID_Org from dbo.BaseTree b where b.UID_PersonHeadSecond5 = @UID_PersonHead and b.UID_OrgRoot = @UID_OrgRoot ) as x join dbo.BasetreeCollectionF co on x.UID_Org = co.UID_ParentOrg join dbo.BaseTree b on co.UID_Org6 = b.UID_Org ) 7