Purchasing.PurchaseOrderDetail

Table: 'Purchasing.PurchaseOrderDetail'

11 fields. 119 bytes.

Individual products associated with a specific purchase order. See PurchaseOrderHeader.

Field NameData TypeSizeOriginal TypeDefaultNullableDescriptionCheck
PurchaseOrderIDint   Not nullPrimary key. Foreign key to PurchaseOrderHeader.PurchaseOrderID. 
PurchaseOrderDetailIDint identity int Not nullPrimary key. One line number per purchased product. 
DueDatedatetime   Not nullDate the product is expected to be received. 
OrderQtysmallint   Not nullQuantity ordered.([OrderQty]>(0))
ProductIDint   Not nullProduct identification number. Foreign key to Product.ProductID. 
UnitPricemoney19,4decimal(19,4) Not nullVendor's selling price of a single product.([UnitPrice]>=(0.00))
LineTotalmoney19,4decimal(19,4) Not nullPer product subtotal. Computed as OrderQty * UnitPrice. 
ReceivedQtydecimal8,2  Not nullQuantity actually received from the vendor.([ReceivedQty]>=(0.00))
RejectedQtydecimal8,2  Not nullQuantity rejected during inspection.([RejectedQty]>=(0.00))
StockedQtydecimal9,2  Not nullQuantity accepted into inventory. Computed as ReceivedQty - RejectedQty. 
ModifiedDatedatetime  getdate()Not nullDate and time the record was last updated. 

Extended Properties

The object has no extended properties.

Primary key for table 'Purchasing.PurchaseOrderDetail'

Primary Key NameField Names
PK_PurchaseOrderDetail_PurchaseOrderID_PurchaseOrderDetailIDPurchaseOrderID, PurchaseOrderDetailID

Foreign keys for table 'Purchasing.PurchaseOrderDetail', 2 items

ForeignPrimaryKey Name
PurchaseOrderDetail.ProductIDProduct.ProductIDFK_PurchaseOrderDetail_Product_ProductID
PurchaseOrderDetail.PurchaseOrderIDPurchaseOrderHeader.PurchaseOrderIDFK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID

Indexes for table 'Purchasing.PurchaseOrderDetail', 2 items

Index NameDescriptionClusteredUniqueFields
PK_PurchaseOrderDetail_PurchaseOrderID_PurchaseOrderDetailIDClustered index created by a primary key constraint.YesYesPurchaseOrderID, PurchaseOrderDetailID
IX_PurchaseOrderDetail_ProductIDNonclustered index.NoNoProductID

Triggers for table 'Purchasing.PurchaseOrderDetail', 2 items

NameDescriptionTypeEnabled
iPurchaseOrderDetailAFTER INSERT trigger that inserts a row in the TransactionHistory table and updates the PurchaseOrderHeader.SubTotal column.after Insert Yes
uPurchaseOrderDetailAFTER UPDATE trigger that inserts a row in the TransactionHistory table, updates ModifiedDate in PurchaseOrderDetail and updates the PurchaseOrderHeader.SubTotal column.after Update Yes

Dependencies for table 'Purchasing.PurchaseOrderDetail', 4 items

Object NameTypeField Name
Purchasing.PurchaseOrderDetailuser tableOrderQty
Purchasing.PurchaseOrderDetailuser tableUnitPrice
Purchasing.PurchaseOrderDetailuser tableReceivedQty
Purchasing.PurchaseOrderDetailuser tableRejectedQty