Difference between revisions of "Sales.SalesOrderDetail (table)"

From dbscript Online Help
Jump to: navigation, search
Line 5: Line 5:
 
| '''Table
 
| '''Table
 
| Sales.SalesOrderDetail
 
| Sales.SalesOrderDetail
 +
|- valign="top"
 +
| '''Description
 +
| Individual products associated with a specific sales order. See SalesOrderHeader.
 
|-
 
|-
 
|}
 
|}
Line 15: Line 18:
 
| '''Nullable
 
| '''Nullable
 
| '''Default
 
| '''Default
| '''PK
+
| '''Description / PK / Index
| '''Index
 
 
 
|-
+
|- valign="top"
 
| SalesOrderID
 
| SalesOrderID
 
| int
 
| int
 
| not null
 
| not null
 
|  
 
|  
| PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID
+
| Primary key. Foreign key to SalesOrderHeader.SalesOrderID.<br />PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID
|
+
|- valign="top"
|-
 
 
| SalesOrderDetailID
 
| SalesOrderDetailID
 
| int
 
| int
 
| not null
 
| not null
 
|  
 
|  
| PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID
+
| Primary key. One incremental unique number per product sold.<br />PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID
|
+
|- valign="top"
|-
 
 
| CarrierTrackingNumber
 
| CarrierTrackingNumber
 
| nvarchar(25)
 
| nvarchar(25)
 
| null
 
| null
 
|  
 
|  
|  
+
| Shipment tracking number supplied by the shipper.<br />
|
+
|- valign="top"
|-
 
 
| OrderQty
 
| OrderQty
 
| smallint
 
| smallint
 
| not null
 
| not null
 
|  
 
|  
|  
+
| Quantity ordered per product.<br />
|
+
|- valign="top"
|-
 
 
| ProductID
 
| ProductID
 
| int
 
| int
 
| not null
 
| not null
 
|  
 
|  
|  
+
| Product sold to customer. Foreign key to Product.ProductID.<br />IX_SalesOrderDetail_ProductID
| IX_SalesOrderDetail_ProductID
+
|- valign="top"
|-
 
 
| SpecialOfferID
 
| SpecialOfferID
 
| int
 
| int
 
| not null
 
| not null
 
|  
 
|  
|  
+
| Promotional code. Foreign key to SpecialOffer.SpecialOfferID.<br />
|
+
|- valign="top"
|-
 
 
| UnitPrice
 
| UnitPrice
 
| money
 
| money
 
| not null
 
| not null
 
|  
 
|  
|  
+
| Selling price of a single product.<br />
|
+
|- valign="top"
|-
 
 
| UnitPriceDiscount
 
| UnitPriceDiscount
 
| money
 
| money
 
| not null
 
| not null
 
| ((0.0))
 
| ((0.0))
|  
+
| Discount amount.<br />
|
+
|- valign="top"
|-
 
 
| LineTotal
 
| LineTotal
 
|  
 
|  
 
|  
 
|  
 
|  
 
|  
|  
+
| Per product subtotal. Computed as UnitPrice * (1 - UnitPriceDiscount) * OrderQty.<br />
|
+
|- valign="top"
|-
 
 
| rowguid
 
| rowguid
 
| uniqueidentifier
 
| uniqueidentifier
 
| not null
 
| not null
 
| (newid())
 
| (newid())
|  
+
| ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.<br />AK_SalesOrderDetail_rowguid
| AK_SalesOrderDetail_rowguid
+
|- valign="top"
|-
 
 
| ModifiedDate
 
| ModifiedDate
 
| datetime
 
| datetime
 
| not null
 
| not null
 
| (getdate())
 
| (getdate())
|  
+
| Date and time the record was last updated.<br />
|
 
 
|}
 
|}
  
Line 125: Line 116:
 
| ON INSERT UPDATE DELETE
 
| ON INSERT UPDATE DELETE
 
|}
 
|}
 +
 +
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 +
| '''Dependency Type
 +
| '''Object Type
 +
| '''Referenced Object
 +
 +
| '''Child Type
 +
| '''Child Object
 +
 +
|-
 +
| Insert
 +
| Table
 +
| [[Production.TransactionHistory_(table)|Production.TransactionHistory]]
 +
 +
| Trigger
 +
| iduSalesOrderDetail
 +
|-
 +
| Update
 +
| Table
 +
| [[Sales.Individual_(table)|Sales.Individual]]
 +
 +
| Trigger
 +
| iduSalesOrderDetail
 +
|-
 +
| Select
 +
| Table
 +
| [[Sales.SalesOrderDetail_(table)|Sales.SalesOrderDetail]]
 +
 +
| Trigger
 +
| iduSalesOrderDetail
 +
|-
 +
| Select
 +
| Table
 +
| [[Sales.SalesOrderHeader_(table)|Sales.SalesOrderHeader]]
 +
 +
| Trigger
 +
| iduSalesOrderDetail
 +
|-
 +
| Update
 +
| Table
 +
| [[Sales.SalesOrderHeader_(table)|Sales.SalesOrderHeader]]
 +
 +
| Trigger
 +
| iduSalesOrderDetail
 +
|-
 +
| Execute
 +
| Procedure
 +
| [[dbo.uspLogError_(procedure)|dbo.uspLogError]]
 +
 +
| Trigger
 +
| iduSalesOrderDetail
 +
|-
 +
| Execute
 +
| Procedure
 +
| [[dbo.uspPrintError_(procedure)|dbo.uspPrintError]]
 +
 +
| Trigger
 +
| iduSalesOrderDetail
 +
|}
 +
 +
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 +
| '''Reference Type
 +
| '''Object Type
 +
| '''Referencing Object
 +
 +
| '''Child Type
 +
| '''Child Object
 +
 +
|-
 +
| Select
 +
| Table
 +
| [[Sales.SalesOrderDetail_(table)|Sales.SalesOrderDetail]]
 +
 +
| Trigger
 +
| iduSalesOrderDetail
 +
|}
 +
 +
 +
 
== automatically generated ==
 
== automatically generated ==
  

Revision as of 22:55, 28 December 2009

wikibot

Table Sales.SalesOrderDetail
Description Individual products associated with a specific sales order. See SalesOrderHeader.


Column Data Type Nullable Default Description / PK / Index
SalesOrderID int not null Primary key. Foreign key to SalesOrderHeader.SalesOrderID.
PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID
SalesOrderDetailID int not null Primary key. One incremental unique number per product sold.
PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID
CarrierTrackingNumber nvarchar(25) null Shipment tracking number supplied by the shipper.
OrderQty smallint not null Quantity ordered per product.
ProductID int not null Product sold to customer. Foreign key to Product.ProductID.
IX_SalesOrderDetail_ProductID
SpecialOfferID int not null Promotional code. Foreign key to SpecialOffer.SpecialOfferID.
UnitPrice money not null Selling price of a single product.
UnitPriceDiscount money not null ((0.0)) Discount amount.
LineTotal Per product subtotal. Computed as UnitPrice * (1 - UnitPriceDiscount) * OrderQty.
rowguid uniqueidentifier not null (newid()) ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
AK_SalesOrderDetail_rowguid
ModifiedDate datetime not null (getdate()) Date and time the record was last updated.


Relation Column Referenced Column
Sales.SalesOrderHeader SalesOrderID SalesOrderID
Sales.SpecialOfferProduct SpecialOfferID SpecialOfferID


Triggers Type
iduSalesOrderDetail ON INSERT UPDATE DELETE


Dependency Type Object Type Referenced Object Child Type Child Object
Insert Table Production.TransactionHistory Trigger iduSalesOrderDetail
Update Table Sales.Individual Trigger iduSalesOrderDetail
Select Table Sales.SalesOrderDetail Trigger iduSalesOrderDetail
Select Table Sales.SalesOrderHeader Trigger iduSalesOrderDetail
Update Table Sales.SalesOrderHeader Trigger iduSalesOrderDetail
Execute Procedure dbo.uspLogError Trigger iduSalesOrderDetail
Execute Procedure dbo.uspPrintError Trigger iduSalesOrderDetail


Reference Type Object Type Referencing Object Child Type Child Object
Select Table Sales.SalesOrderDetail Trigger iduSalesOrderDetail


automatically generated

Table Sales.SalesOrderDetail
Description Individual products associated with a specific sales order. See SalesOrderHeader.


Column Data Type Nullable Default Description / PK / Index
SalesOrderID int not null Primary key. Foreign key to SalesOrderHeader.SalesOrderID.
PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID
SalesOrderDetailID int not null Primary key. One incremental unique number per product sold.
PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID
CarrierTrackingNumber nvarchar(25) null Shipment tracking number supplied by the shipper.
OrderQty smallint not null Quantity ordered per product.
ProductID int not null Product sold to customer. Foreign key to Product.ProductID.
IX_SalesOrderDetail_ProductID
SpecialOfferID int not null Promotional code. Foreign key to SpecialOffer.SpecialOfferID.
UnitPrice money not null Selling price of a single product.
UnitPriceDiscount money not null (0.0) Discount amount.
LineTotal Per product subtotal. Computed as UnitPrice * (1 - UnitPriceDiscount) * OrderQty.
rowguid uniqueidentifier not null (NEWID()) ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
AK_SalesOrderDetail_rowguid
ModifiedDate datetime not null (GETDATE()) Date and time the record was last updated.


Relation Column Referenced Column
Sales.SalesOrderHeader SalesOrderID SalesOrderID
Sales.SpecialOfferProduct SpecialOfferID SpecialOfferID


Triggers Type
iduSalesOrderDetail ON INSERT UPDATE DELETE


Dependency Type Object Type Referenced Object Child Type Child Object
Schema Schema Sales
Insert Table Production.TransactionHistory Trigger iduSalesOrderDetail
Update Table Sales.Individual Trigger iduSalesOrderDetail
Select Table Sales.SalesOrderDetail Trigger iduSalesOrderDetail
Select Table Sales.SalesOrderHeader Trigger iduSalesOrderDetail
Update Table Sales.SalesOrderHeader Trigger iduSalesOrderDetail
Execute Procedure dbo.uspLogError Trigger iduSalesOrderDetail
Execute Procedure dbo.uspPrintError Trigger iduSalesOrderDetail


Reference Type Object Type Referencing Object Child Type Child Object
Select Table Sales.SalesOrderDetail Trigger iduSalesOrderDetail