Back to OIM Explorer

dbo.DPR_FTSchemaAccessChildren

Table FunctionSQL_TABLE_VALUED_FUNCTIONSandbox DB

Table Function.

Source: sandbox-db sys.sql_modules

Source size: 829 characters

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

SQL36 lines
1CREATE FUNCTION dbo.DPR_FTSchemaAccessChildren(2  @UID_Property1 varchar(38),3  @UID_Property2 varchar(38)4) RETURNS @erg TABLE(UIDChild varchar(38) collate database_default primary key5)6  WITH schemabinding7AS8BEGIN9  DECLARE @Anzahl int10  DECLARE @work dbo.QBM_YSingleGUID11  INSERT INTO @work(UID_SingleGuid)12  SELECT @UID_Property113  UNION14  SELECT @UID_Property215  SELECT @Anzahl = 116  WHILE @Anzahl > 017  BEGIN18    INSERT INTO @work(UID_SingleGuid)19    SELECT20      DISTINCT acc.UID_DPRSchemaPropertyTrg21    FROM dbo.DPRSchemaAccess acc22    JOIN @work ph23      ON ph.UID_SingleGuid = acc.UID_DPRSchemaPropertySrc24    WHERE25      acc.AccessType = 'Direct' AND NOT EXISTS(26    SELECT TOP 1 127    FROM @work e28    WHERE29      e.UID_SingleGuid = acc.UID_DPRSchemaPropertyTrg)30    SELECT @Anzahl = @@ROWCOUNT31  END32  INSERT INTO @erg(UIDChild)33  SELECT UID_SingleGuid34  FROM @work endLabel:35  RETURN36END
Open raw exported source
SQL ยท Raw7 lines
1create function dbo.DPR_FTSchemaAccessChildren (@UID_Property1 varchar(38) , @UID_Property2 varchar(38) ) returns @erg table (UIDChild varchar(38) collate2 database_default primary key  ) with schemabinding as begin declare @Anzahl int declare @work dbo.QBM_YSingleGUID insert into @work(UID_SingleGuid) select3 @UID_Property1 union select @UID_Property2 select @Anzahl = 1 while @Anzahl > 0 begin insert into @work(UID_SingleGuid) select distinct acc.UID_DPRSchemaPropertyTrg4  from dbo.DPRSchemaAccess acc join @work ph on ph.UID_SingleGuid = acc.UID_DPRSchemaPropertySrc where acc.AccessType = 'Direct' and not exists (select5 top 1 1 from @work e where e.UID_SingleGuid = acc.UID_DPRSchemaPropertyTrg  ) select @Anzahl = @@ROWCOUNT end insert into @erg(UIDChild) select UID_SingleGuid6 from @work endLabel: return end 7