Generated using SQL Data Dictionary demo version.
Individual products associated with a specific purchase order. See PurchaseOrderHeader.
| Column | Data Type | Identity | Nullable | Default | |
|---|---|---|---|---|---|
| PK, FK | PurchaseOrderID | int | |||
| Primary key. Foreign key to PurchaseOrderHeader.PurchaseOrderID. | |||||
| PK | PurchaseOrderDetailID | int | X | ||
| Primary key. One line number per purchased product. | |||||
| DueDate | datetime | ||||
| Date the product is expected to be received. | |||||
| OrderQty | smallint | ||||
| Quantity ordered. | |||||
| FK | ProductID | int | |||
| Product identification number. Foreign key to Product.ProductID. | |||||
| UnitPrice | money | ||||
| Vendor's selling price of a single product. | |||||
| LineTotal | money | ||||
| Per product subtotal. Computed as OrderQty * UnitPrice. | |||||
| ReceivedQty | decimal(8,2) | ||||
| Quantity actually received from the vendor. | |||||
| RejectedQty | decimal(8,2) | ||||
| Quantity rejected during inspection. | |||||
| StockedQty | decimal(9,2) | ||||
| Quantity accepted into inventory. Computed as ReceivedQty - RejectedQty. | |||||
| ModifiedDate | datetime | getdate() | |||
| Date and time the record was last updated. | |||||
Primary key (clustered) constraint
Nonclustered index.
AFTER INSERT trigger that inserts a row in the TransactionHistory table and updates the PurchaseOrderHeader.SubTotal column.
AFTER UPDATE trigger that inserts a row in the TransactionHistory table, updates ModifiedDate in PurchaseOrderDetail and updates the PurchaseOrderHeader.SubTotal column.