USP_SIMPLEDATALIST_CURRENCIES
Returns a list of currencies and descriptions.
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@INCLUDEINACTIVE | bit | IN | Include inactive |
@INCLUDECURRENCIESWITHOUTRATES | bit | IN | Include currencies without exchange rates |
Definition
Copy
create procedure dbo.USP_SIMPLEDATALIST_CURRENCIES
(
@INCLUDEINACTIVE bit = 0,
@INCLUDECURRENCIESWITHOUTRATES bit = 1
)
as
set nocount on;
if @INCLUDECURRENCIESWITHOUTRATES = 1
select
ID as VALUE,
NAME + ' (' + ISO4217 + ')' as LABEL
from dbo.CURRENCY
where
INACTIVE = 0 or @INCLUDEINACTIVE = 1
order by LABEL
else
select
ID as VALUE,
NAME + ' (' + ISO4217 + ')' as LABEL
from dbo.CURRENCY
where
(INACTIVE = 0 or @INCLUDEINACTIVE = 1)
and exists
(select ID from dbo.CURRENCYEXCHANGERATE
where FROMCURRENCYID = CURRENCY.ID or TOCURRENCYID = CURRENCY.ID)
order by LABEL