Table: [AdventureWorks2016CTP3].[Production].[TransactionHistoryArchive]

CollapseAll image

Collapse image Table properties


Name  Value 
 Schema  [Production]
 Owner  [dbo]
 Table is replicated   
 Creation date  23.10.2015
 ID  974626515
 Located on  PRIMARY
 Data size KB  5000 KB
 Index size KB  3680 KB
 Rows  89253
 ChangeTrackingEnabled   
 FileStreamFileGroup   
 FileStreamPartitionScheme   
 LockEscalation  TABLE
 TrackColumnsUpdatedEnabled   
 Table is filetable   
 Filetable directory   
 Filetable collate   
 Filetable primary key  [PK_TransactionHistoryArchive_TransactionID]
 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 TransactionID     int 4        
  ProductID     int 4        
  ReferenceOrderID     int 4        
  ReferenceOrderLineID     int 4   ((0))    
  TransactionDate     datetime 8   (getdate())    
  TransactionType     nchar 1        
  Quantity     int 4        
  ActualCost     money 8        
  ModifiedDate     datetime 8   (getdate())    
Total: 9 column(s)

Collapse image Indexes


Index  Description  Primary  Unique  Size KB 
[PK_TransactionHistoryArchive_TransactionID] TransactionID   8680 0
[IX_TransactionHistoryArchive_ProductID] ProductID       1536 0
[IX_TransactionHistoryArchive_ReferenceOrderID_ReferenceOrderLineID] ReferenceOrderID       1920 0
Total: 3 Index/indexes

Collapse image Columnstore indexes


No columnstore indexes exist

Collapse image Check constraints


Name  Expression 
CK_TransactionHistoryArchive_TransactionType (upper([TransactionType])='P' OR upper([TransactionType])='S' OR upper([TransactionType])='W')

Collapse image Objects that [Production].[TransactionHistoryArchive] depends on


Object name Object type Dep level
[Production] Schema 1
Total 1 object(s)

Collapse image Extended properties


Name  Value 
MS_Description Transactions for previous years.

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 [Production].[TransactionHistoryArchive] (
        [TransactionID]            [int] NOT NULL,
        [ProductID]                [int] NOT NULL,
        [ReferenceOrderID]         [int] NOT NULL,
        [ReferenceOrderLineID]     [int] NOT NULL,
        [TransactionDate]          [datetime] NOT NULL,
        [TransactionType]          [nchar](1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
        [Quantity]                 [int] NOT NULL,
        [ActualCost]               [money] NOT NULL,
        [ModifiedDate]             [datetime] NOT NULL,
        CONSTRAINT [PK_TransactionHistoryArchive_TransactionID]
        PRIMARY KEY
        CLUSTERED
        ([TransactionID])
    ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Primary key (clustered) constraint', 'SCHEMA', N'Production', 'TABLE', N'TransactionHistoryArchive', 'CONSTRAINT', N'PK_TransactionHistoryArchive_TransactionID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Clustered index created by a primary key constraint.', 'SCHEMA', N'Production', 'TABLE', N'TransactionHistoryArchive', 'INDEX', N'PK_TransactionHistoryArchive_TransactionID'
GO
ALTER TABLE [Production].[TransactionHistoryArchive]
    ADD
    CONSTRAINT [CK_TransactionHistoryArchive_TransactionType]
    CHECK
    (upper([TransactionType])='P' OR upper([TransactionType])='S' OR upper([TransactionType])='W')
GO
EXEC sp_addextendedproperty N'MS_Description', N'Check constraint [TransactionType]=''p'' OR [TransactionType]=''s'' OR [TransactionType]=''w'' OR [TransactionType]=''P'' OR [TransactionType]=''S'' OR [TransactionType]=''W''', 'SCHEMA', N'Production', 'TABLE', N'TransactionHistoryArchive', 'CONSTRAINT', N'CK_TransactionHistoryArchive_TransactionType'
GO
ALTER TABLE [Production].[TransactionHistoryArchive]
CHECK CONSTRAINT [CK_TransactionHistoryArchive_TransactionType]
GO
ALTER TABLE [Production].[TransactionHistoryArchive]
    ADD
    CONSTRAINT [DF_TransactionHistoryArchive_ModifiedDate]
    DEFAULT (getdate()) FOR [ModifiedDate]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Default constraint value of GETDATE()', 'SCHEMA', N'Production', 'TABLE', N'TransactionHistoryArchive', 'CONSTRAINT', N'DF_TransactionHistoryArchive_ModifiedDate'
GO
ALTER TABLE [Production].[TransactionHistoryArchive]
    ADD
    CONSTRAINT [DF_TransactionHistoryArchive_ReferenceOrderLineID]
    DEFAULT ((0)) FOR [ReferenceOrderLineID]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Default constraint value of 0', 'SCHEMA', N'Production', 'TABLE', N'TransactionHistoryArchive', 'CONSTRAINT', N'DF_TransactionHistoryArchive_ReferenceOrderLineID'
GO
ALTER TABLE [Production].[TransactionHistoryArchive]
    ADD
    CONSTRAINT [DF_TransactionHistoryArchive_TransactionDate]
    DEFAULT (getdate()) FOR [TransactionDate]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Default constraint value of GETDATE()', 'SCHEMA', N'Production', 'TABLE', N'TransactionHistoryArchive', 'CONSTRAINT', N'DF_TransactionHistoryArchive_TransactionDate'
GO
CREATE NONCLUSTERED INDEX [IX_TransactionHistoryArchive_ProductID]
    ON [Production].[TransactionHistoryArchive] ([ProductID])
    ON [PRIMARY]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Nonclustered index.', 'SCHEMA', N'Production', 'TABLE', N'TransactionHistoryArchive', 'INDEX', N'IX_TransactionHistoryArchive_ProductID'
GO
CREATE NONCLUSTERED INDEX [IX_TransactionHistoryArchive_ReferenceOrderID_ReferenceOrderLineID]
    ON [Production].[TransactionHistoryArchive] ([ReferenceOrderID], [ReferenceOrderLineID])
    ON [PRIMARY]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Nonclustered index.', 'SCHEMA', N'Production', 'TABLE', N'TransactionHistoryArchive', 'INDEX', N'IX_TransactionHistoryArchive_ReferenceOrderID_ReferenceOrderLineID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Product cost.', 'SCHEMA', N'Production', 'TABLE', N'TransactionHistoryArchive', 'COLUMN', N'ActualCost'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Date and time the record was last updated.', 'SCHEMA', N'Production', 'TABLE', N'TransactionHistoryArchive', 'COLUMN', N'ModifiedDate'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Product identification number. Foreign key to Product.ProductID.', 'SCHEMA', N'Production', 'TABLE', N'TransactionHistoryArchive', 'COLUMN', N'ProductID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Product quantity.', 'SCHEMA', N'Production', 'TABLE', N'TransactionHistoryArchive', 'COLUMN', N'Quantity'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Purchase order, sales order, or work order identification number.', 'SCHEMA', N'Production', 'TABLE', N'TransactionHistoryArchive', 'COLUMN', N'ReferenceOrderID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Line number associated with the purchase order, sales order, or work order.', 'SCHEMA', N'Production', 'TABLE', N'TransactionHistoryArchive', 'COLUMN', N'ReferenceOrderLineID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Date and time of the transaction.', 'SCHEMA', N'Production', 'TABLE', N'TransactionHistoryArchive', 'COLUMN', N'TransactionDate'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Primary key for TransactionHistoryArchive records.', 'SCHEMA', N'Production', 'TABLE', N'TransactionHistoryArchive', 'COLUMN', N'TransactionID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'W = Work Order, S = Sales Order, P = Purchase Order', 'SCHEMA', N'Production', 'TABLE', N'TransactionHistoryArchive', 'COLUMN', N'TransactionType'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Transactions for previous years.', 'SCHEMA', N'Production', 'TABLE', N'TransactionHistoryArchive', NULL, NULL
GO

Collapse image See also


List of tables