Editing Sales.SalesOrderDetail (table)
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 2: | Line 2: | ||
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
− | |- | + | |- |
| '''Table | | '''Table | ||
| Sales.SalesOrderDetail | | Sales.SalesOrderDetail | ||
Line 8: | Line 8: | ||
| '''Description | | '''Description | ||
| Individual products associated with a specific sales order. See SalesOrderHeader. | | Individual products associated with a specific sales order. See SalesOrderHeader. | ||
+ | |- | ||
|} | |} | ||
− | + | ||
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
|- style="background:silver" | |- style="background:silver" | ||
Line 17: | Line 18: | ||
| '''Nullable | | '''Nullable | ||
| '''Default | | '''Default | ||
− | | '''Description | + | | '''Description / PK / Index |
− | + | ||
|- valign="top" | |- valign="top" | ||
| SalesOrderID | | SalesOrderID | ||
Line 24: | Line 25: | ||
| not null | | not null | ||
| | | | ||
− | | Primary key. Foreign key to SalesOrderHeader.SalesOrderID. | + | | Primary key. Foreign key to SalesOrderHeader.SalesOrderID.<br />PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID |
|- valign="top" | |- valign="top" | ||
| SalesOrderDetailID | | SalesOrderDetailID | ||
Line 30: | Line 31: | ||
| not null | | not null | ||
| | | | ||
− | | Primary key. One incremental unique number per product sold. | + | | Primary key. One incremental unique number per product sold.<br />PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID |
|- valign="top" | |- valign="top" | ||
| CarrierTrackingNumber | | CarrierTrackingNumber | ||
Line 36: | Line 37: | ||
| null | | null | ||
| | | | ||
− | | Shipment tracking number supplied by the shipper. | + | | Shipment tracking number supplied by the shipper.<br /> |
|- valign="top" | |- valign="top" | ||
| OrderQty | | OrderQty | ||
Line 42: | Line 43: | ||
| not null | | not null | ||
| | | | ||
− | | Quantity ordered per product. | + | | Quantity ordered per product.<br /> |
|- valign="top" | |- valign="top" | ||
| ProductID | | ProductID | ||
Line 48: | Line 49: | ||
| not null | | not null | ||
| | | | ||
− | | Product sold to customer. Foreign key to Product.ProductID. | + | | Product sold to customer. Foreign key to Product.ProductID.<br />IX_SalesOrderDetail_ProductID |
|- valign="top" | |- valign="top" | ||
| SpecialOfferID | | SpecialOfferID | ||
Line 54: | Line 55: | ||
| not null | | not null | ||
| | | | ||
− | | Promotional code. Foreign key to SpecialOffer.SpecialOfferID. | + | | Promotional code. Foreign key to SpecialOffer.SpecialOfferID.<br /> |
|- valign="top" | |- valign="top" | ||
| UnitPrice | | UnitPrice | ||
Line 60: | Line 61: | ||
| not null | | not null | ||
| | | | ||
− | | Selling price of a single product. | + | | Selling price of a single product.<br /> |
|- valign="top" | |- valign="top" | ||
| UnitPriceDiscount | | UnitPriceDiscount | ||
Line 66: | Line 67: | ||
| not null | | not null | ||
| ((0.0)) | | ((0.0)) | ||
− | | Discount amount. | + | | Discount amount.<br /> |
|- valign="top" | |- valign="top" | ||
| LineTotal | | LineTotal | ||
Line 72: | Line 73: | ||
| | | | ||
| | | | ||
− | | Per product subtotal. Computed as UnitPrice * (1 - UnitPriceDiscount) * OrderQty. | + | | Per product subtotal. Computed as UnitPrice * (1 - UnitPriceDiscount) * OrderQty.<br /> |
|- valign="top" | |- valign="top" | ||
| rowguid | | rowguid | ||
Line 78: | Line 79: | ||
| not null | | not null | ||
| (newid()) | | (newid()) | ||
− | | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | + | | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.<br />AK_SalesOrderDetail_rowguid |
|- valign="top" | |- valign="top" | ||
| ModifiedDate | | ModifiedDate | ||
Line 84: | Line 85: | ||
| not null | | not null | ||
| (getdate()) | | (getdate()) | ||
− | | Date and time the record was last updated. | + | | Date and time the record was last updated.<br /> |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
|- style="background:silver" | |- style="background:silver" | ||
Line 141: | Line 95: | ||
| '''Column | | '''Column | ||
| '''Referenced Column | | '''Referenced Column | ||
− | + | ||
− | |- | + | |- |
| [[Sales.SalesOrderHeader_(table)|Sales.SalesOrderHeader]] | | [[Sales.SalesOrderHeader_(table)|Sales.SalesOrderHeader]] | ||
| SalesOrderID | | SalesOrderID | ||
| SalesOrderID | | SalesOrderID | ||
− | |- | + | |- |
| [[Sales.SpecialOfferProduct_(table)|Sales.SpecialOfferProduct]] | | [[Sales.SpecialOfferProduct_(table)|Sales.SpecialOfferProduct]] | ||
| SpecialOfferID | | SpecialOfferID | ||
Line 152: | Line 106: | ||
|} | |} | ||
− | + | ||
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
|- style="background:silver" | |- style="background:silver" | ||
− | | ''' | + | | '''Triggers |
| '''Type | | '''Type | ||
− | + | ||
− | |- | + | |- |
| iduSalesOrderDetail | | iduSalesOrderDetail | ||
| ON INSERT UPDATE DELETE | | ON INSERT UPDATE DELETE | ||
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
|- style="background:silver" | |- style="background:silver" | ||
Line 256: | Line 127: | ||
| '''Child Object | | '''Child Object | ||
− | |- | + | |- |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
| Insert | | Insert | ||
| Table | | Table | ||
Line 270: | Line 134: | ||
| Trigger | | Trigger | ||
| iduSalesOrderDetail | | iduSalesOrderDetail | ||
− | |- | + | |- |
| Update | | Update | ||
| Table | | Table | ||
Line 277: | Line 141: | ||
| Trigger | | Trigger | ||
| iduSalesOrderDetail | | iduSalesOrderDetail | ||
− | |- | + | |- |
| Select | | Select | ||
| Table | | Table | ||
Line 284: | Line 148: | ||
| Trigger | | Trigger | ||
| iduSalesOrderDetail | | iduSalesOrderDetail | ||
− | |- | + | |- |
| Select | | Select | ||
| Table | | Table | ||
Line 291: | Line 155: | ||
| Trigger | | Trigger | ||
| iduSalesOrderDetail | | iduSalesOrderDetail | ||
− | |- | + | |- |
| Update | | Update | ||
| Table | | Table | ||
Line 298: | Line 162: | ||
| Trigger | | Trigger | ||
| iduSalesOrderDetail | | iduSalesOrderDetail | ||
− | |- | + | |- |
| Execute | | Execute | ||
| Procedure | | Procedure | ||
Line 305: | Line 169: | ||
| Trigger | | Trigger | ||
| iduSalesOrderDetail | | iduSalesOrderDetail | ||
− | |- | + | |- |
| Execute | | Execute | ||
| Procedure | | Procedure | ||
Line 314: | Line 178: | ||
|} | |} | ||
− | + | ||
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
|- style="background:silver" | |- style="background:silver" | ||
Line 324: | Line 188: | ||
| '''Child Object | | '''Child Object | ||
− | |- | + | |- |
| Select | | Select | ||
| Table | | Table | ||
Line 332: | Line 196: | ||
| iduSalesOrderDetail | | iduSalesOrderDetail | ||
|} | |} | ||
+ | |||