AdventureWorks2019
Production.TransactionHistory
//
Record of each purchase order, sales order, or work order transaction year to date.
Created: Modified:
Columns
-
//${escapify(column.description)}[int] IDENTITY (100000,1) NOT NULL
-
//${escapify(column.description)}[int] NOT NULL
-
//${escapify(column.description)}[int] NOT NULL
-
//${escapify(column.description)}[int] NOT NULL DEFAULT ((0))
-
//${escapify(column.description)}[datetime] NOT NULL DEFAULT (getdate())
-
//${escapify(column.description)}[nchar](1) NOT NULL//CONSTRAINT: Check constraint [TransactionType]='p' OR [TransactionType]='s' OR [TransactionType]='w' OR [TransactionType]='P' OR [TransactionType]='S' OR [TransactionType]='W')(upper([TransactionType])='P' OR upper([TransactionType])='S' OR upper([TransactionType])='W')
-
//${escapify(column.description)}[int] NOT NULL
-
//${escapify(column.description)}[money] NOT NULL
-
//${escapify(column.description)}[datetime] NOT NULL DEFAULT (getdate())
Indexes
-
//Clustered index created by a primary key constraint.PK_TransactionHistory_TransactionIDUNIQUE CLUSTEREDTransactionID
-
//Nonclustered index.IX_TransactionHistory_ProductIDNONCLUSTEREDProductID
-
//Nonclustered index.IX_TransactionHistory_ReferenceOrderID_ReferenceOrderLineIDNONCLUSTEREDReferenceOrderID , ReferenceOrderLineID
Foreign Keys
-
//Foreign key constraint referencing Product.ProductID.FK_TransactionHistory_Product_ProductIDProduction.ProductProductID ⥱ ProductID
Sample Data
TransactionID
ProductID
ReferenceOrderID
ReferenceOrderLineID
TransactionDate
TransactionType
Quantity
ActualCost
ModifiedDate
100000
784
41590
NULL
W
2
NULL
100001
794
41591
NULL
W
1
NULL
100002
797
41592
NULL
W
1
NULL
100003
798
41593
NULL
W
1
NULL
100004
799
41594
NULL
W
1
NULL
100005
800
41595
NULL
W
1
NULL
100006
801
41596
NULL
W
1
NULL
100007
954
41597
NULL
W
1
NULL
100008
955
41598
NULL
W
1
NULL
100009
966
41599
NULL
W
1
NULL
100010
968
41600
NULL
W
1
NULL
100011
972
41601
NULL
W
1
NULL
100012
973
41602
NULL
W
1
NULL
100013
974
41603
NULL
W
1
NULL
100014
977
41604
NULL
W
1
NULL
100015
981
41605
NULL
W
1
NULL
100016
989
41606
NULL
W
1
NULL
100017
991
41607
NULL
W
1
NULL
100018
998
41608
NULL
W
3
NULL
100019
514
41609
NULL
W
3
NULL
100020
516
41610
NULL
W
2
NULL
100021
517
41611
NULL
W
4
NULL
100022
518
41612
NULL
W
7
NULL
100023
519
41613
NULL
W
1
NULL
100024
521
41614
NULL
W
1
NULL