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 | ||
− | |- | + | |- |
− | |||
− | |||
|} | |} | ||
− | + | ||
{| 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 15: | ||
| '''Nullable | | '''Nullable | ||
| '''Default | | '''Default | ||
− | | ''' | + | | '''PK |
− | + | | '''Index | |
− | |- | + | |
+ | |- | ||
| SalesOrderID | | SalesOrderID | ||
| int | | int | ||
| not null | | not null | ||
| | | | ||
− | | | + | | PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID |
− | |- | + | | |
+ | |- | ||
| SalesOrderDetailID | | SalesOrderDetailID | ||
| int | | int | ||
| not null | | not null | ||
| | | | ||
− | | | + | | PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID |
− | |- | + | | |
+ | |- | ||
| CarrierTrackingNumber | | CarrierTrackingNumber | ||
| nvarchar(25) | | nvarchar(25) | ||
| null | | null | ||
| | | | ||
− | | | + | | |
− | |- | + | | |
+ | |- | ||
| OrderQty | | OrderQty | ||
| smallint | | smallint | ||
| not null | | not null | ||
| | | | ||
− | | | + | | |
− | |- | + | | |
+ | |- | ||
| ProductID | | ProductID | ||
| int | | int | ||
| not null | | not null | ||
| | | | ||
− | | | + | | |
− | |- | + | | IX_SalesOrderDetail_ProductID |
+ | |- | ||
| SpecialOfferID | | SpecialOfferID | ||
| int | | int | ||
| not null | | not null | ||
| | | | ||
− | | | + | | |
− | |- | + | | |
+ | |- | ||
| UnitPrice | | UnitPrice | ||
| money | | money | ||
| not null | | not null | ||
| | | | ||
− | | | + | | |
− | |- | + | | |
+ | |- | ||
| UnitPriceDiscount | | UnitPriceDiscount | ||
| money | | money | ||
| not null | | not null | ||
| ((0.0)) | | ((0.0)) | ||
− | | | + | | |
− | |- | + | | |
+ | |- | ||
| LineTotal | | LineTotal | ||
| | | | ||
| | | | ||
| | | | ||
− | | | + | | |
− | |- | + | | |
+ | |- | ||
| rowguid | | rowguid | ||
| uniqueidentifier | | uniqueidentifier | ||
| not null | | not null | ||
| (newid()) | | (newid()) | ||
− | | | + | | |
− | |- | + | | AK_SalesOrderDetail_rowguid |
+ | |- | ||
| ModifiedDate | | ModifiedDate | ||
| datetime | | datetime | ||
| not null | | not null | ||
| (getdate()) | | (getdate()) | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
| | | | ||
− | | | + | | |
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{| 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 104: | ||
| '''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 115: | ||
|} | |} | ||
− | + | ||
{| 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 | ||
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== automatically generated == | == automatically generated == | ||
Line 340: | Line 132: | ||
| '''Table | | '''Table | ||
| Sales.SalesOrderDetail | | Sales.SalesOrderDetail | ||
− | |- | + | |- |
+ | |||
| '''Description | | '''Description | ||
| Individual products associated with a specific sales order. See SalesOrderHeader. | | Individual products associated with a specific sales order. See SalesOrderHeader. | ||
|- | |- | ||
+ | |||
|} | |} | ||
Line 353: | Line 147: | ||
| '''Nullable | | '''Nullable | ||
| '''Default | | '''Default | ||
− | | '''Description | + | | '''Description |
+ | | '''PK / Index | ||
− | |- | + | |- |
| SalesOrderID | | SalesOrderID | ||
| int | | int | ||
| not null | | not null | ||
| | | | ||
− | | Primary key. Foreign key to SalesOrderHeader.SalesOrderID. | + | | Primary key. Foreign key to SalesOrderHeader.SalesOrderID. |
− | |- | + | | PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID |
+ | |- | ||
| SalesOrderDetailID | | SalesOrderDetailID | ||
| int | | int | ||
| not null | | not null | ||
| | | | ||
− | | Primary key. One incremental unique number per product sold. | + | | Primary key. One incremental unique number per product sold. |
− | |- | + | | PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID |
+ | |- | ||
| CarrierTrackingNumber | | CarrierTrackingNumber | ||
| nvarchar(25) | | nvarchar(25) | ||
| null | | null | ||
| | | | ||
− | | Shipment tracking number supplied by the shipper. | + | | Shipment tracking number supplied by the shipper. |
− | |- | + | | |
+ | |- | ||
| OrderQty | | OrderQty | ||
| smallint | | smallint | ||
| not null | | not null | ||
| | | | ||
− | | Quantity ordered per product. | + | | Quantity ordered per product. |
− | |- | + | | |
+ | |- | ||
| ProductID | | ProductID | ||
| int | | int | ||
| not null | | not null | ||
| | | | ||
− | | Product sold to customer. Foreign key to Product.ProductID. | + | | Product sold to customer. Foreign key to Product.ProductID. |
− | |- | + | | IX_SalesOrderDetail_ProductID |
+ | |- | ||
| SpecialOfferID | | SpecialOfferID | ||
| int | | int | ||
| not null | | not null | ||
| | | | ||
− | | Promotional code. Foreign key to SpecialOffer.SpecialOfferID. | + | | Promotional code. Foreign key to SpecialOffer.SpecialOfferID. |
− | |- | + | | |
+ | |- | ||
| UnitPrice | | UnitPrice | ||
| money | | money | ||
| not null | | not null | ||
| | | | ||
− | | Selling price of a single product. | + | | Selling price of a single product. |
− | |- | + | | |
+ | |- | ||
| UnitPriceDiscount | | UnitPriceDiscount | ||
| money | | money | ||
| not null | | not null | ||
| (0.0) | | (0.0) | ||
− | | Discount amount. | + | | Discount amount. |
− | |- | + | | |
+ | |- | ||
| LineTotal | | LineTotal | ||
| | | | ||
| | | | ||
| | | | ||
− | | Per product subtotal. Computed as UnitPrice * (1 - UnitPriceDiscount) * OrderQty. | + | | Per product subtotal. Computed as UnitPrice * (1 - UnitPriceDiscount) * OrderQty. |
− | |- | + | | |
+ | |- | ||
| rowguid | | rowguid | ||
| uniqueidentifier | | uniqueidentifier | ||
| 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. |
− | |- | + | | AK_SalesOrderDetail_rowguid |
+ | |- | ||
| ModifiedDate | | ModifiedDate | ||
| datetime | | datetime | ||
| not null | | not null | ||
| (GETDATE()) | | (GETDATE()) | ||
− | | Date and time the record was last updated. | + | | Date and time the record was last updated. |
+ | | | ||
|} | |} | ||
Line 450: | Line 256: | ||
| iduSalesOrderDetail | | iduSalesOrderDetail | ||
| ON INSERT UPDATE DELETE | | ON INSERT UPDATE DELETE | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} |