Table: [AdventureWorks2016CTP3].[Sales].[CountryRegionCurrency]

CollapseAll image

Collapse image Table properties


Name  Value 
 Schema  [Sales]
 Owner  [dbo]
 Table is replicated   
 Creation date  23.10.2015
 ID  1125579048
 Located on  PRIMARY
 Data size KB  8 KB
 Index size KB  24 KB
 Rows  109
 ChangeTrackingEnabled   
 FileStreamFileGroup   
 FileStreamPartitionScheme   
 LockEscalation  TABLE
 TrackColumnsUpdatedEnabled   
 Table is filetable   
 Filetable directory   
 Filetable collate   
 Filetable primary key  [PK_CountryRegionCurrency_CountryRegionCode_CurrencyCode]
 Filetable streamid unique   
 Filetable fullpath unique   
 Filetable is enabled   
 Is memory optimized   
 Durability  SCHEMA_AND_DATA

Collapse image Creation options


Name  Value 
QUOTED_IDENTIFIER ON
ANSI_NULLS ON
ANSI_PADDING ON

Collapse image Columns


    Name  Description  Data type  Max length  Nullable  Default IsGUID  SPARSE Computed value
Primary key Foreign key CountryRegionCode     nvarchar 3        
Primary key Foreign key CurrencyCode     nchar 3        
    ModifiedDate     datetime 8   (getdate())    
Total: 3 column(s)

Collapse image Indexes


Index  Description  Primary  Unique  Size KB 
[PK_CountryRegionCurrency_CountryRegionCode_CurrencyCode] CountryRegionCode   32 0
[IX_CountryRegionCurrency_CurrencyCode] CurrencyCode       16 0
Total: 2 Index/indexes

Collapse image Columnstore indexes


No columnstore indexes exist

Collapse image Referenced tables


Table  Primary key or unique constraint  Foreign key 
[Person].[CountryRegion] PK_CountryRegion_CountryRegionCode FK_CountryRegionCurrency_CountryRegion_CountryRegionCode
[Sales].[Currency] PK_Currency_CurrencyCode FK_CountryRegionCurrency_Currency_CurrencyCode
Total: 2 table(s)

Collapse image Objects that [Sales].[CountryRegionCurrency] depends on


Object name Object type Dep level
[Sales] Schema 1
[Person].[CountryRegion] Table 1
[Sales].[Currency] Table 1
Total 3 object(s)

Collapse image Extended properties


Name  Value 
MS_Description Cross-reference table mapping ISO currency codes to a country or region.

Collapse image Table options


Name  Value 
Pintable OFF
Table lock on bulk load OFF
Insert row lock OFF
Text in row 0
Large value types out of row OFF

Collapse image SQL


SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING ON
GO
CREATE TABLE [Sales].[CountryRegionCurrency] (
        [CountryRegionCode]     [nvarchar](3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
        [CurrencyCode]          [nchar](3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
        [ModifiedDate]          [datetime] NOT NULL,
        CONSTRAINT [PK_CountryRegionCurrency_CountryRegionCode_CurrencyCode]
        PRIMARY KEY
        CLUSTERED
        ([CountryRegionCode], [CurrencyCode])
    ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Primary key (clustered) constraint', 'SCHEMA', N'Sales', 'TABLE', N'CountryRegionCurrency', 'CONSTRAINT', N'PK_CountryRegionCurrency_CountryRegionCode_CurrencyCode'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Clustered index created by a primary key constraint.', 'SCHEMA', N'Sales', 'TABLE', N'CountryRegionCurrency', 'INDEX', N'PK_CountryRegionCurrency_CountryRegionCode_CurrencyCode'
GO
ALTER TABLE [Sales].[CountryRegionCurrency]
    ADD
    CONSTRAINT [DF_CountryRegionCurrency_ModifiedDate]
    DEFAULT (getdate()) FOR [ModifiedDate]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Default constraint value of GETDATE()', 'SCHEMA', N'Sales', 'TABLE', N'CountryRegionCurrency', 'CONSTRAINT', N'DF_CountryRegionCurrency_ModifiedDate'
GO
ALTER TABLE [Sales].[CountryRegionCurrency]
    WITH CHECK
    ADD CONSTRAINT [FK_CountryRegionCurrency_CountryRegion_CountryRegionCode]
    FOREIGN KEY ([CountryRegionCode]) REFERENCES [Person].[CountryRegion] ([CountryRegionCode])
ALTER TABLE [Sales].[CountryRegionCurrency]
    CHECK CONSTRAINT [FK_CountryRegionCurrency_CountryRegion_CountryRegionCode]

GO
EXEC sp_addextendedproperty N'MS_Description', N'Foreign key constraint referencing CountryRegion.CountryRegionCode.', 'SCHEMA', N'Sales', 'TABLE', N'CountryRegionCurrency', 'CONSTRAINT', N'FK_CountryRegionCurrency_CountryRegion_CountryRegionCode'
GO
ALTER TABLE [Sales].[CountryRegionCurrency]
    WITH CHECK
    ADD CONSTRAINT [FK_CountryRegionCurrency_Currency_CurrencyCode]
    FOREIGN KEY ([CurrencyCode]) REFERENCES [Sales].[Currency] ([CurrencyCode])
ALTER TABLE [Sales].[CountryRegionCurrency]
    CHECK CONSTRAINT [FK_CountryRegionCurrency_Currency_CurrencyCode]

GO
EXEC sp_addextendedproperty N'MS_Description', N'Foreign key constraint referencing Currency.CurrencyCode.', 'SCHEMA', N'Sales', 'TABLE', N'CountryRegionCurrency', 'CONSTRAINT', N'FK_CountryRegionCurrency_Currency_CurrencyCode'
GO
CREATE NONCLUSTERED INDEX [IX_CountryRegionCurrency_CurrencyCode]
    ON [Sales].[CountryRegionCurrency] ([CurrencyCode])
    ON [PRIMARY]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Nonclustered index.', 'SCHEMA', N'Sales', 'TABLE', N'CountryRegionCurrency', 'INDEX', N'IX_CountryRegionCurrency_CurrencyCode'
GO
EXEC sp_addextendedproperty N'MS_Description', N'ISO code for countries and regions. Foreign key to CountryRegion.CountryRegionCode.', 'SCHEMA', N'Sales', 'TABLE', N'CountryRegionCurrency', 'COLUMN', N'CountryRegionCode'
GO
EXEC sp_addextendedproperty N'MS_Description', N'ISO standard currency code. Foreign key to Currency.CurrencyCode.', 'SCHEMA', N'Sales', 'TABLE', N'CountryRegionCurrency', 'COLUMN', N'CurrencyCode'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Date and time the record was last updated.', 'SCHEMA', N'Sales', 'TABLE', N'CountryRegionCurrency', 'COLUMN', N'ModifiedDate'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Cross-reference table mapping ISO currency codes to a country or region.', 'SCHEMA', N'Sales', 'TABLE', N'CountryRegionCurrency', NULL, NULL
GO

Collapse image See also


List of tables