| Owner: | Production |
| Creation Date: | 04/26/2006 |
| Located On: | PRIMARY |
| Data Size KB: | 24 |
| Index Size KB: | 16 |
| Rows: | 395 |
| Description: | Changes in the cost of a product over time. |
| Name | Data Type | Length | NULL | Default | IsIdentity | IsGUID | Description | ||
| ProductID | int | 4 | Product identification number. Foreign key to Product.ProductID | ||||||
| StartDate | datetime | 8 | Product cost start date. | ||||||
| EndDate | datetime | 8 | Product cost end date. | ||||||
| StandardCost | money | 8 | Standard cost of the product. | ||||||
| ModifiedDate | datetime | 8 | (getdate()) | Date and time the record was last updated. |
| Index | Primary | Unique | Description | |
| PK_ProductCostHistory_ProductID_StartDate | Primary key (clustered) constraint |
| Name | Expression | |
| CK_ProductCostHistory_EndDate | ([EndDate]>=[StartDate] OR [EndDate] IS NULL) | |
| CK_ProductCostHistory_StandardCost | ([StandardCost]>=(0.00)) |
| Table | Foreign Key | Primary Key or Unique Constraint | |
| Production.Product | FK_ProductCostHistory_Product_ProductID | PK_Product_ProductID |
Objects that [Production].[ProductCostHistory] depends on
| Object Name | Owner | Object Type | Dep Level | |
| Flag | dbo | User Defined type | 1 | |
| Name | dbo | User Defined type | 1 | |
| ProductCategory | Production | Table | 2 | |
| ProductModel | Production | Table | 2 | |
| UnitMeasure | Production | Table | 2 | |
| ProductSubcategory | Production | Table | 3 | |
| Product | Production | Table | 4 |
Objects that depend on [Production].[ProductCostHistory]
| Object Name | Owner | Object Type | Dep Level | |
| ufnGetProductStandardCost | dbo | Function | 1 |
CREATE TABLE [ProductCostHistory] (
[ProductID] [int] NOT NULL ,
[StartDate] [datetime] NOT NULL ,
[EndDate] [datetime] NULL ,
[StandardCost] [money] NOT NULL ,
[ModifiedDate] [datetime] NOT NULL CONSTRAINT [DF_ProductCostHistory_ModifiedDate] DEFAULT (getdate()),
CONSTRAINT [PK_ProductCostHistory_ProductID_StartDate] PRIMARY KEY CLUSTERED
(
[ProductID],
[StartDate]
) ON [PRIMARY] ,
CONSTRAINT [FK_ProductCostHistory_Product_ProductID] FOREIGN KEY
(
[ProductID]
) REFERENCES [Product] (
[ProductID]
),
CONSTRAINT [CK_ProductCostHistory_EndDate] CHECK ([EndDate]>=[StartDate] OR [EndDate] IS NULL),
CONSTRAINT [CK_ProductCostHistory_StandardCost] CHECK ([StandardCost]>=(0.00))
) ON [PRIMARY]
GO
See Also
List of tables