dbo.CPL_FTComplianceSubRulePersonR
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.CPL_FTComplianceSubRulePerson source text reference
Complete Source
1CREATE FUNCTION dbo.CPL_FTComplianceSubRulePersonR(2 @UID_ComplianceRule varchar(38),3 @PersonsPossible QBM_YParameterList READONLY4) RETURNS TABLE5AS6RETURN(7SELECT csp.UID_Person8FROM dbo.ComplianceSubRulePerson csp9JOIN dbo.ComplianceRule r10 ON csp.UID_ComplianceRule = r.UID_ComplianceRule11JOIN @PersonsPossible pp12 ON csp.UID_Person = pp.Parameter113WHERE14 r.UID_ComplianceRule = @UID_ComplianceRule AND r.IsPersonStoreInverted = 0 AND r.IsInActive = 0 AND r.IsWorkingCopy = 015UNION all16SELECT p.Parameter1 AS UID_Person17FROM @PersonsPossible p CROSS18JOIN dbo.ComplianceRule r19LEFT20OUTER21JOIN dbo.ComplianceSubRulePerson csp22 ON p.Parameter1 = csp.UID_Person AND csp.UID_ComplianceRule = r.UID_ComplianceRule23WHERE24 csp.UID_Person IS NULL AND r.UID_ComplianceRule = @UID_ComplianceRule AND r.IsPersonStoreInverted = 1 AND r.IsInActive = 0 AND r.IsWorkingCopy25= 0)
Open raw exported source
1create function dbo.CPL_FTComplianceSubRulePersonR (@UID_ComplianceRule varchar(38) , @PersonsPossible QBM_YParameterList readonly ) returns table as 2return( select csp.UID_Person from dbo.ComplianceSubRulePerson csp join dbo.ComplianceRule r on csp.UID_ComplianceRule = r.UID_ComplianceRule join @PersonsPossible3 pp on csp.UID_Person = pp.Parameter1 where r.UID_ComplianceRule = @UID_ComplianceRule and r.IsPersonStoreInverted = 0 and r.IsInActive = 0 and r.IsWorkingCopy4 = 0 union all select p.Parameter1 as UID_Person from @PersonsPossible p cross join dbo.ComplianceRule r left outer join dbo.ComplianceSubRulePerson 5csp on p.Parameter1 = csp.UID_Person and csp.UID_ComplianceRule = r.UID_ComplianceRule where csp.UID_Person is null and r.UID_ComplianceRule = @UID_ComplianceRule6 and r.IsPersonStoreInverted = 1 and r.IsInActive = 0 and r.IsWorkingCopy = 0 ) 7