dbo.DPR_FTSystemMapChildren
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
- No typed edges extracted for this source.
References
- No direct source references extracted.
Referenced By
- No direct source references extracted.
Complete Source
1CREATE FUNCTION dbo.DPR_FTSystemMapChildren(2 @UID_Property1 varchar(38)3) RETURNS @erg TABLE(UIDChild varchar(38) collate database_default primary key4)5 WITH schemabinding6AS7BEGIN8 DECLARE @Anzahl int9 DECLARE @work dbo.QBM_YSingleGUID10 INSERT INTO @work(UID_SingleGuid)11 SELECT @UID_Property112 SELECT @Anzahl = 113 WHILE @Anzahl > 014 BEGIN15 INSERT INTO @work(UID_SingleGuid)16 SELECT17 DISTINCT sm.UID_BaseDPRSystemMap18 FROM dbo.DPRSystemMap sm19 JOIN @work ph20 ON ph.UID_SingleGuid = sm.UID_DPRSystemMap21 WHERE22 sm.MappingDirection <> 'DoNotMap' AND sm.UID_BaseDPRSystemMap > ' ' AND NOT EXISTS(23 SELECT TOP 1 124 FROM @work e25 WHERE26 e.UID_SingleGuid = sm.UID_BaseDPRSystemMap)27 SELECT @Anzahl = @@ROWCOUNT28 END29 INSERT INTO @erg(UIDChild)30 SELECT w.UID_SingleGuid31 FROM @work w endLabel:32 RETURN33END
Open raw exported source
1create function dbo.DPR_FTSystemMapChildren (@UID_Property1 varchar(38) ) returns @erg table (UIDChild varchar(38) collate database_default primary key2 ) with schemabinding as begin declare @Anzahl int declare @work dbo.QBM_YSingleGUID insert into @work(UID_SingleGuid) select @UID_Property1 select @Anzahl3 = 1 while @Anzahl > 0 begin insert into @work(UID_SingleGuid) select distinct sm.UID_BaseDPRSystemMap from dbo.DPRSystemMap sm join @work ph on ph.UID_SingleGuid4 = sm.UID_DPRSystemMap where sm.MappingDirection <> 'DoNotMap' and sm.UID_BaseDPRSystemMap > ' ' and not exists (select top 1 1 from @work e where e.UID_SingleGuid5 = sm.UID_BaseDPRSystemMap ) select @Anzahl = @@ROWCOUNT end insert into @erg(UIDChild) select w.UID_SingleGuid from @work w endLabel: return end 6