BATCHCURRENCYEXCHANGERATE

Stores currency exchange rate batch information

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
RATE decimal(20, 8) Default = 0 The rate to use when performing the conversion.
ASOFDATE datetime The date for which the exchange rate is valid.
ASOFTIME time The time for which the exchange rate is valid.
TYPECODE tinyint Default = 0 The type of the exchange rate.
SEQUENCE int Default = 0
DATEADDED datetime Default = getdate() Indicates the date this record was added.
DATECHANGED datetime Default = getdate() Indicates the date this record was last changed.
TS timestamp Timestamp.
TSLONG bigint (Computed) yes CONVERT(bigint, TS) Numeric representation of the timestamp.
TYPE nvarchar(9) (Computed) yes CASE [TYPECODE] WHEN 0 THEN N'Corporate' WHEN 1 THEN N'Daily' END Provides a translation for the 'TYPECODE' field.

Foreign Keys

Foreign Key Field Type Null Notes Description
BATCHID uniqueidentifier BATCH.ID FK to BATCH
FROMCURRENCYID uniqueidentifier CURRENCY.ID The currency from which the conversion is taking place.
TOCURRENCYID uniqueidentifier CURRENCY.ID The currency to which the conversion is taking place.
SOURCECODEID uniqueidentifier yes CURRENCYEXCHANGERATESOURCECODE.ID The source for the exchange rate.
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
TIMEZONEENTRYID uniqueidentifier TIMEZONEENTRY.ID The time zone for which the exchange rate is valid.

Indexes

Index Name Fields Unique Primary Clustered
IX_BATCHCURRENCYEXCHANGERATE_BATCHID BATCHID
IX_BATCHCURRENCYEXCHANGERATE_DATEADDED DATEADDED yes
IX_BATCHCURRENCYEXCHANGERATE_DATECHANGED DATECHANGED
PK_BATCHCURRENCYEXCHANGERATE ID yes yes

Triggers

Trigger Name Description
TR_BATCHCURRENCYEXCHANGERATE_AUDIT_UPDATE
TR_BATCHCURRENCYEXCHANGERATE_AUDIT_DELETE

Referenced by

Referenced by Field
BATCHCURRENCYEXCHANGERATEBATCHSYSTEMMESSAGES BATCHCURRENCYEXCHANGERATEID
BATCHCURRENCYEXCHANGERATEBATCHUSERMESSAGE ID