Back to OIM Explorer

dbo.QBM_FGIPrimaryKeyCount

Scalar FunctionSQL_SCALAR_FUNCTIONSandbox DB

Scalar Function.

Source: sandbox-db sys.sql_modules

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

SQL26 lines
1CREATE FUNCTION dbo.QBM_FGIPrimaryKeyCount(2  @TableName varchar(30)3) RETURNS int4AS5BEGIN6  DECLARE @erg int = 07  IF @TableName IN(8    SELECT TableName9    FROM QBM_VStartupTables)10  BEGIN11    SELECT TOP 1 @erg = CountKeys12    FROM QBM_VStartupTables13    WHERE14      TableName = @TableName15    RETURN(@erg)16  END17  SELECT @erg = count(*)18  FROM dialogColumn c19    WITH(readpast)20  JOIN DialogTable t21    WITH(readpast)22    ON c.UID_DialogTable = t.UID_DialogTable23  WHERE24    t.TableName = @TableName AND c.IsPKMember = 1 endLabel:25  RETURN(@erg)26END
Open raw exported source
SQL ยท Raw5 lines
1   create   function dbo.QBM_FGIPrimaryKeyCount( @TableName varchar(30) ) returns int as begin declare @erg int = 0  if @TableName in (select TableName2 from QBM_VStartupTables) begin select top 1 @erg = CountKeys from QBM_VStartupTables where TableName = @TableName  return(@erg)  end select @erg = count3(*) from dialogColumn c with (readpast) join DialogTable t with (readpast) on c.UID_DialogTable = t.UID_DialogTable where t.TableName = @TableName and 4c.IsPKMember = 1 endLabel: return (@erg) end 5