UFN_RE7INTEGRATION_GETINCOMECOMPENSATION

Return

Return Type
table

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN
@TOPN int IN

Definition

Copy


            CREATE function dbo.UFN_RE7INTEGRATION_GETINCOMECOMPENSATION(@ID uniqueidentifier, @TOPN integer = 100)
            returns table
            as
                return
          select top (@TOPN)
            ID,
            COMPANY as DESCRIPTION,
            TOTALCOMPENSATION as VALUE
          from 
            dbo.WPINCOMECOMPENSATION
          where 
            WEALTHID = @ID and CONFIRMED = 1 and HISTORICCODE <> 1
          order by 
            VALUE desc, DESCRIPTION asc;