Production.TransactionHistory (table)

From dbscript Online Help
Revision as of 23:06, 2 February 2010 by Bot (talk | contribs)
Jump to: navigation, search

wikibot

Table Production.TransactionHistory
Description Record of each purchase order, sales order, or work order transaction year to date.


Columns

Column Data Type Nullable Default Description
TransactionID int not null Primary key for TransactionHistory records.
ProductID int not null Product identification number. Foreign key to Product.ProductID.
ReferenceOrderID int not null Purchase order, sales order, or work order identification number.
ReferenceOrderLineID int not null ((0)) Line number associated with the purchase order, sales order, or work order.
TransactionDate datetime not null (getdate()) Date and time of the transaction.
TransactionType nchar(1) not null W = WorkOrder, S = SalesOrder, P = PurchaseOrder
Quantity int not null Product quantity.
ActualCost money not null Product cost.
ModifiedDate datetime not null (getdate()) Date and time the record was last updated.

Primary Key

Primary Key Columns
PK_TransactionHistory_TransactionID TransactionID

Indexes

Index Type Columns
IX_TransactionHistory_ProductID ProductID
IX_TransactionHistory_ReferenceOrderID_ReferenceOrderLineID ReferenceOrderID, ReferenceOrderLineID

Check Constraints

Check Constraint Expression Description
CK_TransactionHistory_TransactionType (upper([TransactionType])='P' OR upper([TransactionType])='S' OR upper([TransactionType])='W') Check constraint [TransactionType]='p' OR [TransactionType]='s' OR [TransactionType]='w' OR [TransactionType]='P' OR [TransactionType]='S' OR [TransactionType]='W')

Foreign Keys

Relation Column Referenced Column
Production.Product ProductID ProductID

References

Dependency Type Object Type Referenced Object
Schema Schema Production

Dependencies

Reference Type Object Type Referencing Object Child Type Child Object
Insert Table Production.WorkOrder Trigger iWorkOrder
Insert Table Production.WorkOrder Trigger uWorkOrder
Insert Table Purchasing.PurchaseOrderDetail Trigger iPurchaseOrderDetail
Insert Table Purchasing.PurchaseOrderDetail Trigger uPurchaseOrderDetail
Insert Table Sales.SalesOrderDetail Trigger iduSalesOrderDetail


automatically generated

Table Production.TransactionHistory
Description Record of each purchase order, sales order, or work order transaction year to date.


Column Data Type Nullable Default Description / PK / Index
TransactionID int not null Primary key for TransactionHistory records.
PK_TransactionHistory_TransactionID
ProductID int not null Product identification number. Foreign key to Product.ProductID.
IX_TransactionHistory_ProductID
ReferenceOrderID int not null Purchase order, sales order, or work order identification number.
IX_TransactionHistory_ReferenceOrderID_ReferenceOrderLineID
ReferenceOrderLineID int not null (0) Line number associated with the purchase order, sales order, or work order.
IX_TransactionHistory_ReferenceOrderID_ReferenceOrderLineID
TransactionDate datetime not null (GETDATE()) Date and time of the transaction.
TransactionType nchar(1) not null W = WorkOrder, S = SalesOrder, P = PurchaseOrder
Quantity int not null Product quantity.
ActualCost money not null Product cost.
ModifiedDate datetime not null (GETDATE()) Date and time the record was last updated.


Relation Column Referenced Column
Production.Product ProductID ProductID


Dependency Type Object Type Referenced Object
Schema Schema Production


Reference Type Object Type Referencing Object Child Type Child Object
Insert Table Production.WorkOrder Trigger iWorkOrder
Insert Table Production.WorkOrder Trigger uWorkOrder
Insert Table Purchasing.PurchaseOrderDetail Trigger iPurchaseOrderDetail
Insert Table Purchasing.PurchaseOrderDetail Trigger uPurchaseOrderDetail
Insert Table Sales.SalesOrderDetail Trigger iduSalesOrderDetail