Difference between revisions of "Production.ProductCostHistory (table)"

From dbscript Online Help
Jump to: navigation, search
 
(6 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
|-
+
|- valign="top"
 
| '''Table
 
| '''Table
 
| Production.ProductCostHistory
 
| Production.ProductCostHistory
|-
+
|- valign="top"
 +
| '''Description
 +
| Changes in the cost of a product over time.
 
|}
 
|}
  
 
+
=== Columns ===
 
{| 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 15: Line 17:
 
| '''Nullable
 
| '''Nullable
 
| '''Default
 
| '''Default
| '''PK
+
| '''Description
| '''Index
+
 
+
|- valign="top"
|-
 
 
| ProductID
 
| ProductID
 
| int
 
| int
 
| not null
 
| not null
 
|  
 
|  
| PK_ProductCostHistory_ProductID_StartDate
+
| Product identification number. Foreign key to Product.ProductID
|
+
|- valign="top"
|-
 
 
| StartDate
 
| StartDate
 
| datetime
 
| datetime
 
| not null
 
| not null
 
|  
 
|  
| PK_ProductCostHistory_ProductID_StartDate
+
| Product cost start date.
|
+
|- valign="top"
|-
 
 
| EndDate
 
| EndDate
 
| datetime
 
| datetime
 
| null
 
| null
 
|  
 
|  
|  
+
| Product cost end date.
|
+
|- valign="top"
|-
 
 
| StandardCost
 
| StandardCost
 
| money
 
| money
 
| not null
 
| not null
 
|  
 
|  
|  
+
| Standard cost of the product.
|
+
|- valign="top"
|-
 
 
| ModifiedDate
 
| ModifiedDate
 
| datetime
 
| datetime
 
| not null
 
| not null
 
| (getdate())
 
| (getdate())
|  
+
| Date and time the record was last updated.
|  
+
|}
 +
 
 +
=== Primary Key ===
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 +
| '''Primary Key
 +
| '''Columns
 +
|- valign="top"
 +
| PK_ProductCostHistory_ProductID_StartDate
 +
| ProductID, StartDate
 
|}
 
|}
  
 +
=== Check Constraints ===
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 +
| '''Check Constraint
 +
| '''Expression
 +
| '''Description
  
 +
|- valign="top"
 +
| CK_ProductCostHistory_EndDate
 +
| ([EndDate]>=[StartDate] OR [EndDate] IS NULL)
 +
| Check constraint [EndDate] >= [StartDate] OR [EndDate] IS NULL
 +
|- valign="top"
 +
| CK_ProductCostHistory_StandardCost
 +
| ([StandardCost]>=(0.00))
 +
| Check constraint [StandardCost] >= (0.00)
 +
|}
  
 +
=== Foreign Keys ===
 
{| 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 62: Line 84:
 
| '''Column
 
| '''Column
 
| '''Referenced Column
 
| '''Referenced Column
+
 
|-
+
|- valign="top"
 
| [[Production.Product_(table)|Production.Product]]
 
| [[Production.Product_(table)|Production.Product]]
 
| ProductID
 
| ProductID
 
| ProductID
 
| ProductID
 
|}
 
|}
 +
 +
=== References ===
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 +
| '''Dependency Type
 +
| '''Object Type
 +
| '''Referenced Object
 +
 +
|- valign="top"
 +
| Schema
 +
| Schema
 +
| [[Production_(schema)|Production]]
 +
 +
|}
 +
 +
=== Dependencies ===
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 +
| '''Reference Type
 +
| '''Object Type
 +
| '''Referencing Object
 +
 +
|- valign="top"
 +
| Select
 +
| Function
 +
| [[dbo.ufnGetProductStandardCost_(function)|dbo.ufnGetProductStandardCost]]
 +
 +
|}
 +
 +
 
== automatically generated ==
 
== automatically generated ==
  
Line 75: Line 127:
 
| Production.ProductCostHistory
 
| Production.ProductCostHistory
 
|- valign="top"
 
|- valign="top"
 
 
| '''Description
 
| '''Description
 
| Changes in the cost of a product over time.
 
| Changes in the cost of a product over time.
 
|-
 
|-
 
 
|}
 
|}
  
Line 140: Line 190:
 
{| 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"
| '''Referencing Object
+
| '''Dependency Type
 
| '''Object Type
 
| '''Object Type
 +
| '''Referenced Object
 +
 +
|-
 +
| Schema
 +
| Schema
 +
| [[Production_(schema)|Production]]
 +
 +
|}
 +
 +
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 
| '''Reference Type
 
| '''Reference Type
+
| '''Object Type
 +
| '''Referencing Object
 +
 
 
|-
 
|-
 +
| Select
 +
| Function
 
| [[dbo.ufnGetProductStandardCost_(function)|dbo.ufnGetProductStandardCost]]
 
| [[dbo.ufnGetProductStandardCost_(function)|dbo.ufnGetProductStandardCost]]
| Function
+
 
| Select
 
 
|}
 
|}

Latest revision as of 00:16, 24 June 2010

wikibot[edit]

Table Production.ProductCostHistory
Description Changes in the cost of a product over time.

Columns[edit]

Column Data Type Nullable Default Description
ProductID int not null Product identification number. Foreign key to Product.ProductID
StartDate datetime not null Product cost start date.
EndDate datetime null Product cost end date.
StandardCost money not null Standard cost of the product.
ModifiedDate datetime not null (getdate()) Date and time the record was last updated.

Primary Key[edit]

Primary Key Columns
PK_ProductCostHistory_ProductID_StartDate ProductID, StartDate

Check Constraints[edit]

Check Constraint Expression Description
CK_ProductCostHistory_EndDate ([EndDate]>=[StartDate] OR [EndDate] IS NULL) Check constraint [EndDate] >= [StartDate] OR [EndDate] IS NULL
CK_ProductCostHistory_StandardCost ([StandardCost]>=(0.00)) Check constraint [StandardCost] >= (0.00)

Foreign Keys[edit]

Relation Column Referenced Column
Production.Product ProductID ProductID

References[edit]

Dependency Type Object Type Referenced Object
Schema Schema Production

Dependencies[edit]

Reference Type Object Type Referencing Object
Select Function dbo.ufnGetProductStandardCost


automatically generated[edit]

Table Production.ProductCostHistory
Description Changes in the cost of a product over time.


Column Data Type Nullable Default Description / PK / Index
ProductID int not null Product identification number. Foreign key to Product.ProductID
PK_ProductCostHistory_ProductID_StartDate
StartDate datetime not null Product cost start date.
PK_ProductCostHistory_ProductID_StartDate
EndDate datetime null Product cost end date.
StandardCost money not null Standard cost of the product.
ModifiedDate datetime not null (GETDATE()) Date and time the record was last updated.


Relation Column Referenced Column
Production.Product ProductID ProductID


Dependency Type Object Type Referenced Object
Schema Schema Production


Reference Type Object Type Referencing Object
Select Function dbo.ufnGetProductStandardCost