UFN_BANKACCOUNTADJUSTMENT_GETNEXTNUMBER

Gets the next available adjustment number

Return

Return Type
int

Parameters

Parameter Parameter Type Mode Description
@BANKACCOUNTID uniqueidentifier IN

Definition

Copy


            CREATE function dbo.UFN_BANKACCOUNTADJUSTMENT_GETNEXTNUMBER
            (
                @BANKACCOUNTID uniqueidentifier
            )
            returns integer
            with execute as caller
            as begin
                declare @NUMBER integer;
                select @NUMBER= ISNULL(MAX(SEQUENCE),0) + 1
                from dbo.BANKACCOUNTADJUSTMENT
                where BANKACCOUNTID=@BANKACCOUNTID
                return @NUMBER
            end