UFN_BANKACCOUNTDEPOSIT_NUMBEROFPAYMENTS

This function returns the number of payments associated with a deposit.

Return

Return Type
int

Parameters

Parameter Parameter Type Mode Description
@DEPOSITID uniqueidentifier IN

Definition

Copy


            CREATE function dbo.UFN_BANKACCOUNTDEPOSIT_NUMBEROFPAYMENTS
            (
                @DEPOSITID uniqueidentifier
            )
            returns integer
            with execute as caller
            as begin
                declare @NUMBER integer = 0;

                select @NUMBER = count (ID)
                            from dbo.BANKACCOUNTDEPOSITPAYMENT
                            where BANKACCOUNTDEPOSITPAYMENT.DEPOSITID=@DEPOSITID

                return @NUMBER
            end