Sales.SalesOrderDetail

Table: 'Sales.SalesOrderDetail'

11 fields. 182 bytes.

Individual products associated with a specific sales order. See SalesOrderHeader.

Field NameData TypeSizeOriginal TypeDefaultNullableDescriptionCheck
SalesOrderIDint   Not nullPrimary key. Foreign key to SalesOrderHeader.SalesOrderID. 
SalesOrderDetailIDint identity int Not nullPrimary key. One incremental unique number per product sold. 
CarrierTrackingNumbernvarchar25  NullShipment tracking number supplied by the shipper. 
OrderQtysmallint   Not nullQuantity ordered per product.([OrderQty]>(0))
ProductIDint   Not nullProduct sold to customer. Foreign key to Product.ProductID. 
SpecialOfferIDint   Not nullPromotional code. Foreign key to SpecialOffer.SpecialOfferID. 
UnitPricemoney19,4decimal(19,4) Not nullSelling price of a single product.([UnitPrice]>=(0.00))
UnitPriceDiscountmoney19,4decimal(19,4)(0.0)Not nullDiscount amount.([UnitPriceDiscount]>=(0.00))
LineTotalnumeric38,6  Not nullPer product subtotal. Computed as UnitPrice * (1 - UnitPriceDiscount) * OrderQty. 
rowguiduniqueidentifier  newid()Not nullROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. 
ModifiedDatedatetime  getdate()Not nullDate and time the record was last updated. 

Extended Properties

The object has no extended properties.

Primary key for table 'Sales.SalesOrderDetail'

Primary Key NameField Names
PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailIDSalesOrderID, SalesOrderDetailID

Foreign keys for table 'Sales.SalesOrderDetail', 3 items

ForeignPrimaryKey Name
SalesOrderDetail.SalesOrderIDSalesOrderHeader.SalesOrderIDFK_SalesOrderDetail_SalesOrderHeader_SalesOrderID
SalesOrderDetail.SpecialOfferIDSpecialOfferProduct.SpecialOfferIDFK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID
SalesOrderDetail.ProductIDSpecialOfferProduct.ProductIDFK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID

Indexes for table 'Sales.SalesOrderDetail', 3 items

Index NameDescriptionClusteredUniqueFields
PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailIDClustered index created by a primary key constraint.YesYesSalesOrderID, SalesOrderDetailID
AK_SalesOrderDetail_rowguidUnique nonclustered index. Used to support replication samples.NoYesrowguid
IX_SalesOrderDetail_ProductIDNonclustered index.NoNoProductID

Triggers for table 'Sales.SalesOrderDetail', 1 item

NameDescriptionTypeEnabled
iduSalesOrderDetailAFTER INSERT, DELETE, UPDATE trigger that inserts a row in the TransactionHistory table, updates ModifiedDate in SalesOrderDetail and updates the SalesOrderHeader.SubTotal column.after Insert Update Delete Yes

Dependencies for table 'Sales.SalesOrderDetail', 3 items

Object NameTypeField Name
Sales.SalesOrderDetailuser tableOrderQty
Sales.SalesOrderDetailuser tableUnitPrice
Sales.SalesOrderDetailuser tableUnitPriceDiscount