Back to OIM Explorer

dbo.QER_FTHelperHeadOrgParents_RT

Inline Table FunctionSQL_INLINE_TABLE_VALUED_FUNCTIONSandbox DB

Inline Table Function.

Source: sandbox-db sys.sql_modules

Source size: 798 characters

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_FTHelperHeadOrgParents source text reference

References

Referenced By

  • No direct source references extracted.

Complete Source

SQL31 lines
1CREATE FUNCTION dbo.QER_FTHelperHeadOrgParents_RT(2  @UID_PersonHead varchar(38),3  @UID_OrgRoot varchar(38)4) RETURNS TABLE5  WITH schemabinding6AS7RETURN(8SELECT9  DISTINCT b.UID_Org AS UID_ParentOrg,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_OrgRoot23UNION24SELECT 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_Org30JOIN dbo.BaseTree b31  ON co.uid_parentOrg = b.UID_Org)
Open raw exported source
SQL ยท Raw7 lines
1create function dbo.QER_FTHelperHeadOrgParents_RT (@UID_PersonHead varchar(38) , @UID_OrgRoot varchar(38) )  returns table with schemabinding as return2 ( select distinct b.UID_Org as UID_ParentOrg , b.XObjectKey as XObjectKey from ( select hho.UID_Org from dbo.HelperHeadOrg hho join dbo.BaseTree b on 3hho.UID_Org = 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 from4 dbo.BaseTree b where b.UID_PersonHead = @UID_PersonHead and b.UID_OrgRoot = @UID_OrgRoot union 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_Org join dbo.BaseTree b on co.uid_parentOrg6 = b.UID_Org ) 7