Back to OIM Explorer

dbo.TSB_FTTSBAccountDefPredecessor

Table FunctionSQL_TABLE_VALUED_FUNCTIONSandbox DB

Table Function.

Source: sandbox-db sys.sql_modules

Source size: 1.153 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

Complete Source

SQL43 lines
1CREATE FUNCTION dbo.TSB_FTTSBAccountDefPredecessor(2  @UID_TSBAccountDef varchar(38)3) RETURNS @erg TABLE(UID_TSBAccountDef varchar(38) collate database_default,4UID_TSBAccountDefPredecessor varchar(38) collate database_default5)6  WITH schemabinding7AS8BEGIN9  DECLARE @UID_TSBAccountDefSearch varchar(38)10  DECLARE @UID_TSBAccountDefPredecessor varchar(38)11  SELECT @UID_TSBAccountDefSearch = @UID_TSBAccountDef12  INSERT INTO @erg(UID_TSBAccountDefPredecessor,13  UID_TSBAccountDef)14  SELECT15    @UID_TSBAccountDef,16    @UID_TSBAccountDef marke:17  SELECT @UID_TSBAccountDefPredecessor = NULL18  SELECT TOP 1 @UID_TSBAccountDefPredecessor = r.UID_TSBAccountDefPredecessor19  FROM dbo.TSBAccountDef r20  WHERE21    r.UID_TSBAccountDef = @UID_TSBAccountDefSearch22  IF @UID_TSBAccountDefPredecessor > ' '23  BEGIN24    INSERT INTO @erg(UID_TSBAccountDefPredecessor,25    UID_TSBAccountDef)26    SELECT27      @UID_TSBAccountDefPredecessor,28      @UID_TSBAccountDef29    WHERE30      NOT EXISTS(31    SELECT TOP 1 132    FROM @erg e33    WHERE34      e.UID_TSBAccountDefPredecessor = @UID_TSBAccountDefPredecessor)35    IF @@ROWCOUNT > 036    BEGIN37      SELECT @UID_TSBAccountDefSearch = @UID_TSBAccountDefPredecessor38      GOTO marke39    END40  END41  EndLabel:42  RETURN43END
Open raw exported source
SQL ยท Raw9 lines
1create function dbo.TSB_FTTSBAccountDefPredecessor(@UID_TSBAccountDef varchar(38) ) returns @erg table ( UID_TSBAccountDef varchar(38) collate database_default2 , UID_TSBAccountDefPredecessor varchar(38) collate database_default ) with schemabinding as begin declare @UID_TSBAccountDefSearch varchar(38) declare3 @UID_TSBAccountDefPredecessor varchar(38) select @UID_TSBAccountDefSearch = @UID_TSBAccountDef insert into @erg (UID_TSBAccountDefPredecessor, UID_TSBAccountDef4) select @UID_TSBAccountDef, @UID_TSBAccountDef marke: select @UID_TSBAccountDefPredecessor = null select top 1 @UID_TSBAccountDefPredecessor = r.UID_TSBAccountDefPredecessor5 from dbo.TSBAccountDef r where r.UID_TSBAccountDef = @UID_TSBAccountDefSearch if @UID_TSBAccountDefPredecessor > ' ' begin insert into @erg (UID_TSBAccountDefPredecessor6, UID_TSBAccountDef) select @UID_TSBAccountDefPredecessor, @UID_TSBAccountDef where Not exists (select top 1 1 from @erg e where e.UID_TSBAccountDefPredecessor7 = @UID_TSBAccountDefPredecessor ) if @@ROWCOUNT > 0 begin select @UID_TSBAccountDefSearch = @UID_TSBAccountDefPredecessor goto marke end end EndLabel:8 return end 9