Generated using SQL Data Dictionary demo version.
Individual products associated with a specific sales order. See SalesOrderHeader.
| Column | Data Type | Identity | Nullable | Default | |
|---|---|---|---|---|---|
| PK, FK | SalesOrderID | int | |||
| Primary key. Foreign key to SalesOrderHeader.SalesOrderID. | |||||
| PK | SalesOrderDetailID | int | X | ||
| Primary key. One incremental unique number per product sold. | |||||
| CarrierTrackingNumber | nvarchar(25) | X | |||
| Shipment tracking number supplied by the shipper. | |||||
| OrderQty | smallint | ||||
| Quantity ordered per product. | |||||
| FK | ProductID | int | |||
| Product sold to customer. Foreign key to Product.ProductID. | |||||
| FK | SpecialOfferID | int | |||
| Promotional code. Foreign key to SpecialOffer.SpecialOfferID. | |||||
| UnitPrice | money | ||||
| Selling price of a single product. | |||||
| UnitPriceDiscount | money | 0.0 | |||
| Discount amount. | |||||
| LineTotal | numeric(38,6) | ||||
| Per product subtotal. Computed as UnitPrice * (1 - UnitPriceDiscount) * OrderQty. | |||||
| UK | rowguid | uniqueidentifier | newid() | ||
| ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
| ModifiedDate | datetime | getdate() | |||
| Date and time the record was last updated. | |||||
Primary key (clustered) constraint
Unique nonclustered index. Used to support replication samples.
Nonclustered index.
AFTER INSERT, DELETE, UPDATE trigger that inserts a row in the TransactionHistory table, updates ModifiedDate in SalesOrderDetail and updates the SalesOrderHeader.SubTotal column.