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

From dbscript Online Help
Jump to: navigation, search
Line 125: Line 125:
 
| ON INSERT UPDATE DELETE
 
| ON INSERT UPDATE DELETE
 
|}
 
|}
 
 
== automatically generated ==
 
== automatically generated ==
  
Line 147: Line 146:
 
| '''Nullable
 
| '''Nullable
 
| '''Default
 
| '''Default
| '''Description
+
| '''Description / PK / Index
| '''PK / Index
 
 
 
|-
+
|- valign="top"
 
| 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
| PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID
+
|- valign="top"
|-
 
 
| 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
| PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID
+
|- valign="top"
|-
 
 
| CarrierTrackingNumber
 
| CarrierTrackingNumber
 
| nvarchar(25)
 
| nvarchar(25)
Line 170: Line 166:
 
|  
 
|  
 
| Shipment tracking number supplied by the shipper.
 
| Shipment tracking number supplied by the shipper.
|
+
|- valign="top"
|-
 
 
| OrderQty
 
| OrderQty
 
| smallint
 
| smallint
Line 177: Line 172:
 
|  
 
|  
 
| Quantity ordered per product.
 
| Quantity ordered per product.
|
+
|- valign="top"
|-
 
 
| 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
| IX_SalesOrderDetail_ProductID
+
|- valign="top"
|-
 
 
| SpecialOfferID
 
| SpecialOfferID
 
| int
 
| int
Line 191: Line 184:
 
|  
 
|  
 
| Promotional code. Foreign key to SpecialOffer.SpecialOfferID.
 
| Promotional code. Foreign key to SpecialOffer.SpecialOfferID.
|
+
|- valign="top"
|-
 
 
| UnitPrice
 
| UnitPrice
 
| money
 
| money
Line 198: Line 190:
 
|  
 
|  
 
| Selling price of a single product.
 
| Selling price of a single product.
|
+
|- valign="top"
|-
 
 
| UnitPriceDiscount
 
| UnitPriceDiscount
 
| money
 
| money
Line 205: Line 196:
 
| (0.0)
 
| (0.0)
 
| Discount amount.
 
| Discount amount.
|
+
|- valign="top"
|-
 
 
| LineTotal
 
| LineTotal
 
|  
 
|  
Line 212: Line 202:
 
|  
 
|  
 
| Per product subtotal. Computed as UnitPrice * (1 - UnitPriceDiscount) * OrderQty.
 
| Per product subtotal. Computed as UnitPrice * (1 - UnitPriceDiscount) * OrderQty.
|
+
|- 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.
+
| ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.AK_SalesOrderDetail_rowguid
| AK_SalesOrderDetail_rowguid
+
|- valign="top"
|-
 
 
| ModifiedDate
 
| ModifiedDate
 
| datetime
 
| datetime
Line 226: Line 214:
 
| (GETDATE())
 
| (GETDATE())
 
| Date and time the record was last updated.
 
| Date and time the record was last updated.
|
 
 
|}
 
|}
  
Line 256: Line 243:
 
| iduSalesOrderDetail
 
| iduSalesOrderDetail
 
| ON INSERT UPDATE DELETE
 
| ON INSERT UPDATE DELETE
 +
|}
 +
 +
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 +
| '''Referenced Object
 +
| '''Object Type
 +
| '''Dependency Type
 +
 +
|-
 +
| [[Production.TransactionHistory_(table)|Production.TransactionHistory]]
 +
| Table
 +
| Insert
 +
|-
 +
| [[Sales.Individual_(table)|Sales.Individual]]
 +
| Table
 +
| Update
 +
|-
 +
| [[Sales.SalesOrderDetail_(table)|Sales.SalesOrderDetail]]
 +
| Table
 +
| Select
 +
|-
 +
| [[Sales.SalesOrderHeader_(table)|Sales.SalesOrderHeader]]
 +
| Table
 +
| Select
 +
|-
 +
| [[Sales.SalesOrderHeader_(table)|Sales.SalesOrderHeader]]
 +
| Table
 +
| Update
 +
|-
 +
| [[dbo.uspLogError_(procedure)|dbo.uspLogError]]
 +
| Procedure
 +
| Execute
 +
|-
 +
| [[dbo.uspPrintError_(procedure)|dbo.uspPrintError]]
 +
| Procedure
 +
| Execute
 +
|}
 +
 +
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 +
| '''Referencing Object
 +
| '''Object Type
 +
| '''Reference Type
 +
 +
|-
 +
| [[Sales.SalesOrderDetail_(table)|Sales.SalesOrderDetail]]
 +
| Table
 +
| Select
 
|}
 
|}

Revision as of 23:58, 26 November 2009

wikibot

Table Sales.SalesOrderDetail


Column Data Type Nullable Default PK Index
SalesOrderID int not null PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID
SalesOrderDetailID int not null PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID
CarrierTrackingNumber nvarchar(25) null
OrderQty smallint not null
ProductID int not null IX_SalesOrderDetail_ProductID
SpecialOfferID int not null
UnitPrice money not null
UnitPriceDiscount money not null ((0.0))
LineTotal
rowguid uniqueidentifier not null (newid()) AK_SalesOrderDetail_rowguid
ModifiedDate datetime not null (getdate())


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


Triggers Type
iduSalesOrderDetail ON INSERT UPDATE DELETE

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


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


Referencing Object Object Type Reference Type
Sales.SalesOrderDetail Table Select