AdventureWorks
Sales.Currency Table
Description
Lookup table containing standard ISO currencies.
Properties
Creation Date08/01/2010 08:40
File GroupPRIMARY
Text File Group
System Object
Published for Replication
Rows105
Data Space Used8.00 KB
Index Space Used24.00 KB
Columns
 Column NameDescriptionDatatypeLengthAllow NullsDefaultFormula
Primary Key CurrencyCodeThe ISO code for the Currency.nchar3   
 NameCurrency name.dbo.Name50   
 ModifiedDateDate and time the record was last updated.datetime4 
(getdate())
 
Indexes
IndexDescriptionPrimaryUnique
AK_Currency_NameUnique nonclustered index. 
PK_Currency_CurrencyCodePrimary key (clustered) constraint
Relationships
RelationshipDescription
FK_CountryRegionCurrency_Currency_CurrencyCodeForeign key constraint referencing Currency.CurrencyCode.
FK_CurrencyRate_Currency_FromCurrencyCodeForeign key constraint referencing Currency.FromCurrencyCode.
FK_CurrencyRate_Currency_ToCurrencyCodeForeign key constraint referencing Currency.ToCurrencyCode.
Objects that depend on Sales.Currency
 Database ObjectObject TypeDescriptionDep Level
Sales.CountryRegionCurrency tableSales.CountryRegionCurrencyTableCross-reference table mapping ISO currency codes to a country or region.1
Sales.CurrencyRate tableSales.CurrencyRateTableCurrency exchange rates.1
iduSalesOrderDetail triggeriduSalesOrderDetailTriggerAFTER INSERT, DELETE, UPDATE trigger that inserts a row in the TransactionHistory table, updates ModifiedDate in SalesOrderDetail and updates the SalesOrderHeader.SubTotal column.4
Sales.SalesOrderDetail tableSales.SalesOrderDetailTableIndividual products associated with a specific sales order. See SalesOrderHeader.3
Sales.SalesOrderHeader tableSales.SalesOrderHeaderTableGeneral sales order information.2
Sales.SalesOrderHeaderSalesReason tableSales.SalesOrderHeaderSalesReasonTableCross-reference table mapping sales orders to sales reason codes.3
uSalesOrderHeader triggeruSalesOrderHeaderTriggerAFTER UPDATE trigger that updates the RevisionNumber and ModifiedDate columns in the SalesOrderHeader table.Updates the SalesYTD column in the SalesPerson and SalesTerritory tables.3
Sales.vSalesPersonSalesByFiscalYears viewSales.vSalesPersonSalesByFiscalYearsViewUses PIVOT to return aggregated sales information for each sales representative.3
Objects that Sales.Currency depends on
 Database ObjectObject TypeDescriptionDep Level
dbo.Name datatypedbo.NameUser Defined Data Type 1
SQL
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [Sales].[Currency](
	[CurrencyCode] [nchar](3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[Name] [dbo].[Name] NOT NULL,
	[ModifiedDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Currency_CurrencyCode] PRIMARY KEY CLUSTERED 
(
	[CurrencyCode] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

ALTER TABLE [Sales].[Currency] ADD  CONSTRAINT [DF_Currency_ModifiedDate]  DEFAULT (getdate()) FOR [ModifiedDate]
See Also

Related Objects

Sales Schema
AdventureWorks Database

 

 


© 2012 All Rights Reserved.

Send comments on this topic.