| AdventureWorks Database > Production Schema : Production.TransactionHistory Table |
| Creation Date | 08/01/2010 08:40 |
| File Group | PRIMARY |
| Text File Group | |
| System Object | ![]() |
| Published for Replication | ![]() |
| Rows | 113443 |
| Data Space Used | 6,304.00 KB |
| Index Space Used | 2,992.00 KB |
| Column Name | Description | Datatype | Length | Allow Nulls | Default | Formula | |
|---|---|---|---|---|---|---|---|
| TransactionID | Primary key for TransactionHistory records. | int | 4 | |||
| ProductID | Product identification number. Foreign key to Product.ProductID. | int | 4 | ||||
| ReferenceOrderID | Purchase order, sales order, or work order identification number. | int | 4 | ||||
| ReferenceOrderLineID | Line number associated with the purchase order, sales order, or work order. | int | 4 | ((0)) | |||
| TransactionDate | Date and time of the transaction. | datetime | 4 | (getdate()) | |||
| TransactionType | W = WorkOrder, S = SalesOrder, P = PurchaseOrder | nchar | 1 | ||||
| Quantity | Product quantity. | int | 4 | ||||
| ActualCost | Product cost. | money | 8 | ||||
| ModifiedDate | Date and time the record was last updated. | datetime | 4 | (getdate()) |
| Index | Description | Primary | Unique |
|---|---|---|---|
| IX_TransactionHistory_ProductID | Nonclustered index. | ||
| IX_TransactionHistory_ReferenceOrderID_ReferenceOrderLineID | Nonclustered index. | ||
| PK_TransactionHistory_TransactionID | Primary key (clustered) constraint | ![]() | ![]() |
| Name | Description | Expression |
|---|---|---|
| CK_TransactionHistory_TransactionType | 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') |
| Relationship | Description |
|---|---|
| FK_TransactionHistory_Product_ProductID | Foreign key constraint referencing Product.ProductID. |
| Database Object | Object Type | Description | Dep Level | |
|---|---|---|---|---|
![]() | iduSalesOrderDetail | Trigger | AFTER INSERT, DELETE, UPDATE trigger that inserts a row in the TransactionHistory table, updates ModifiedDate in SalesOrderDetail and updates the SalesOrderHeader.SubTotal column. | 2 |
![]() | iPurchaseOrderDetail | Trigger | AFTER INSERT trigger that inserts a row in the TransactionHistory table and updates the PurchaseOrderHeader.SubTotal column. | 2 |
![]() | iWorkOrder | Trigger | AFTER INSERT trigger that inserts a row in the TransactionHistory table. | 2 |
![]() | Purchasing.PurchaseOrderDetail | Table | Individual products associated with a specific purchase order. See PurchaseOrderHeader. | 1 |
![]() | Sales.SalesOrderDetail | Table | Individual products associated with a specific sales order. See SalesOrderHeader. | 1 |
![]() | uPurchaseOrderDetail | Trigger | AFTER UPDATE trigger that inserts a row in the TransactionHistory table, updates ModifiedDate in PurchaseOrderDetail and updates the PurchaseOrderHeader.SubTotal column. | 2 |
![]() | uWorkOrder | Trigger | AFTER UPDATE trigger that inserts a row in the TransactionHistory table, updates ModifiedDate in the WorkOrder table. | 2 |
![]() | Production.WorkOrder | Table | Manufacturing work orders. | 1 |
![]() | Production.WorkOrderRouting | Table | Work order details. | 2 |
| Database Object | Object Type | Description | Dep Level | |
|---|---|---|---|---|
![]() | dbo.Flag | User Defined Data Type | 2 | |
![]() | dbo.Name | User Defined Data Type | 2 | |
![]() | Production.Product | Table | Products sold or used in the manfacturing of sold products. | 1 |
![]() | Production.ProductCategory | Table | High-level product categorization. | 3 |
![]() | Production.ProductModel | Table | Product model classification. | 2 |
![]() | Production.ProductSubcategory | Table | Product subcategories. See ProductCategory table. | 2 |
![]() | Production.UnitMeasure | Table | Unit of measure lookup table. | 2 |
|