Back to OIM Explorer

dbo.QBM_FGITimeIsValid

Scalar FunctionSQL_SCALAR_FUNCTIONSandbox DB

Scalar Function.

Source: sandbox-db sys.sql_modules

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

SQL42 lines
1CREATE FUNCTION dbo.QBM_FGITimeIsValid(2  @Time nvarchar(5)3) RETURNS int4  WITH SCHEMABINDING5AS6BEGIN7  DECLARE @isValid int8  SELECT @isValid = 19  IF @Time > ' '10  BEGIN11    IF @Time LIKE N '[0-2][0-9]:[0-5][0-9]'12    BEGIN13      IF convert(int,14      LEFT(@Time, 2)) BETWEEN 0 AND 23 AND convert(int,15      RIGHT(@Time, 2)) BETWEEN 0 AND 5916      BEGIN17        SELECT @isValid = 118      END19      ELSE20      BEGIN21        SELECT @isValid = -222      END23    END24    ELSE25    BEGIN26      IF @Time = 'LB:ST'27      BEGIN28        SELECT @isValid = 229      END30      ELSE31      BEGIN32        SELECT @isValid = -133      END34    END35  END36  ELSE37  BEGIN38    SELECT @isValid = 039  END40  ende:41  RETURN(@isValid)42END
Open raw exported source
SQL ยท Raw5 lines
1  create   function dbo.QBM_FGITimeIsValid(@Time nvarchar(5)) returns int with SCHEMABINDING as begin declare @isValid int select @isValid = 1 if2 @Time > ' ' begin  if @Time like N'[0-2][0-9]:[0-5][0-9]' begin  if convert(int, left(@Time, 2)) between 0 and 23 and convert(int, right(@Time, 2)) between3 0 and 59 begin  select @isValid = 1  end else begin  select @isValid = -2 end end else begin   if @Time = 'LB:ST'  begin select @isValid = 2 end else 4begin select @isValid = -1 end end end else begin  select @isValid = 0 end ende: return (@isValid) end 5