Back to OIM Explorer

dbo.QBM_FGIBitPatternXMarkedForDel

Scalar FunctionSQL_SCALAR_FUNCTIONSandbox DB

Scalar Function.

Source: sandbox-db sys.sql_modules

Source size: 463 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.

Complete Source

SQL18 lines
1CREATE FUNCTION dbo.QBM_FGIBitPatternXMarkedForDel(2  @PatternNames nvarchar(256),3  @AllExceptThis BIT4) RETURNS int5  WITH SCHEMABINDING6AS7BEGIN8  RETURN(9  SELECT CASE @AllExceptThis10  WHEN 0 THEN11  SUM(DISTINCT v.xvalue)12  ELSE ~ SUM(DISTINCT v.xvalue)13  END14  FROM(15  VALUES('Delay', 1),('OutStanding', 2),('QBMLock', 4),('Publishing', 8),('', 0)) AS v(xkey, xvalue)16  JOIN string_split(isnull(@PatternNames, ''), '|') AS s17    ON v.xkey = s.value)18END
Open raw exported source
SQL ยท Raw5 lines
1      create   function dbo.QBM_FGIBitPatternXMarkedForDel( @PatternNames nvarchar(256)  , @AllExceptThis bit  ) returns int with SCHEMABINDING 2as begin return( select case @AllExceptThis when 0 then SUM(distinct v.xvalue) else ~ SUM(distinct v.xvalue) end from ( values ('Delay', 1) , ('OutStanding'3, 2) , ('QBMLock', 4) , ('Publishing', 8) , ('', 0) ) as v (xkey, xvalue) join string_split(isnull(@PatternNames, ''), '|') as s on v.xkey = s.value ) 4end 5