dbo.ARS_FTAttestationRulerPA
Table FunctionSQL_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.ARS_FTPersonFromEdsva source text reference
Complete Source
1CREATE FUNCTION dbo.ARS_FTAttestationRulerPA(2 @UID_AttestationCase varchar(38)3) RETURNS @erg TABLE(UID_Person varchar(38) collate database_default4)5AS6BEGIN7 DECLARE @Ownerlist nvarchar(max) = NULL8 DECLARE @ObjectKeyBase varchar(138) = NULL9 SELECT TOP 1 @ObjectKeyBase = ac.ObjectKeyBase10 FROM AttestationCase ac11 WHERE12 ac.UID_AttestationCase = @UID_AttestationCase13 IF @ObjectKeyBase IS NULL14 BEGIN15 GOTO endlabel16 END17 IF @ObjectKeyBase LIKE '<Key><T>ADSGroup</T>%'18 BEGIN19 SELECT TOP 1 @Ownerlist = g.edsvaSecondaryOwners20 FROM ADSGroup g21 WHERE22 g.XObjectKey = @ObjectKeyBase23 END24 IF @ObjectKeyBase LIKE '<Key><T>ADSAccountInADSGroup</T>%'25 BEGIN26 SELECT TOP 1 @Ownerlist = g.edsvaSecondaryOwners27 FROM ADSAccountInADSGroup gig28 JOIN ADSGroup g29 ON g.UID_ADSGroup = gig.UID_ADSGroup30 WHERE31 gig.XObjectKey = @ObjectKeyBase32 END33 IF @ObjectKeyBase LIKE '<Key><T>ADSGroupInADSGroup</T>%'34 BEGIN35 SELECT TOP 1 @Ownerlist = g.edsvaSecondaryOwners36 FROM ADSGroupInADSGroup gg37 JOIN ADSGroup g38 ON g.UID_ADSGroup = gg.UID_ADSGroupParent39 WHERE40 gg.XObjectKey = @ObjectKeyBase41 END42 IF @Ownerlist IS NULL43 BEGIN44 GOTO endLabel45 END46 INSERT INTO @erg(UID_Person)47 SELECT l.UID_Person48 FROM dbo.ARS_FTPersonFromEdsva(@Ownerlist) l endLabel:49 RETURN50END
Open raw exported source
1create function dbo.ARS_FTAttestationRulerPA (@UID_AttestationCase varchar(38) ) returns @erg table ( UID_Person varchar(38) collate database_default )2 AS begin declare @Ownerlist nvarchar(max) = null declare @ObjectKeyBase varchar(138) = null select top 1 @ObjectKeyBase = ac.ObjectKeyBase from AttestationCase3 ac where ac.UID_AttestationCase = @UID_AttestationCase if @ObjectKeyBase is null begin goto endlabel end if @ObjectKeyBase like '<Key><T>ADSGroup</T>%'4 begin select top 1 @Ownerlist = g.edsvaSecondaryOwners from ADSGroup g where g.XObjectKey = @ObjectKeyBase end if @ObjectKeyBase like '<Key><T>ADSAccountInADSGroup</T>%'5 begin select top 1 @Ownerlist = g.edsvaSecondaryOwners from ADSAccountInADSGroup gig join ADSGroup g on g.UID_ADSGroup = gig.UID_ADSGroup where gig.XObjectKey6 = @ObjectKeyBase end If @ObjectKeyBase like '<Key><T>ADSGroupInADSGroup</T>%' begin select top 1 @Ownerlist = g.edsvaSecondaryOwners from ADSGroupInADSGroup7 gg JOIN ADSGroup g on g.UID_ADSGroup = gg.UID_ADSGroupParent where gg.XObjectKey = @ObjectKeyBase end if @Ownerlist is null begin goto endLabel end insert8 into @erg(UID_Person) select l.UID_Person from dbo.ARS_FTPersonFromEdsva(@Ownerlist) l endLabel: return end 9