UFN_CURRENCYSET_BASEANDTRANSACTIONCURRENCYCOMBOISVALID

Validates a combination of base and transaction currencies by checking for a currency set which contains both

Return

Return Type
bit

Parameters

Parameter Parameter Type Mode Description
@BASECURRENCYID uniqueidentifier IN
@TRANSACTIONCURRENCYID uniqueidentifier IN

Definition

Copy


create function dbo.UFN_CURRENCYSET_BASEANDTRANSACTIONCURRENCYCOMBOISVALID
(
    @BASECURRENCYID uniqueidentifier,
    @TRANSACTIONCURRENCYID uniqueidentifier
)
returns bit
with execute as caller
as begin

    declare @comboIsValid bit = 0
    if exists (
        select 1
        from dbo.CURRENCYSET 
        inner join dbo.CURRENCYSETTRANSACTIONCURRENCY [TXCURRENCY] on [TXCURRENCY].CURRENCYSETID = CURRENCYSET.ID
        where CURRENCYSET.BASECURRENCYID = @BASECURRENCYID and [TXCURRENCY].CURRENCYID = @TRANSACTIONCURRENCYID
        )
        set @comboIsValid = 1;
    return @comboIsValid;

end