Properties

Owner: Production 
Creation Date: 04/26/2006 
Located On: PRIMARY 
Data Size KB: 24 
Index Size KB: 16 
Rows: 395 
Description: Changes in the list price of a product over time. 

Columns

Name Data Type Length NULL Default IsIdentity IsGUID Description
    ProductID  int          Product identification number. Foreign key to Product.ProductID 
    StartDate  datetime          List price start date. 
    EndDate  datetime          List price end date 
    ListPrice  money          Product list price. 
    ModifiedDate  datetime    (getdate())      Date and time the record was last updated. 
Total: 5 column(s)

Indexes

Index Primary Unique Description
  PK_ProductListPriceHistory_ProductID_StartDate      Primary key (clustered) constraint 
Total: 1 index(es)

Check Constraints

Name Expression
  CK_ProductListPriceHistory_EndDate  ([EndDate]>=[StartDate] OR [EndDate] IS NULL) 
  CK_ProductListPriceHistory_ListPrice  ([ListPrice]>(0.00)) 
Total: 2 constraint(s)

Referenced Tables

Table Foreign Key Primary Key or Unique Constraint
  Production.Product  FK_ProductListPriceHistory_Product_ProductID  PK_Product_ProductID 
Total: 1 table(s)

Objects that [Production].[ProductListPriceHistory] depends on

Object Name Owner Object Type Dep Level
  Flag  dbo  User Defined type 
  Name  dbo  User Defined type 
  ProductCategory  Production  Table 
  ProductModel  Production  Table 
  UnitMeasure  Production  Table 
  ProductSubcategory  Production  Table 
  Product  Production  Table 
Total: 7 object(s)

Objects that depend on [Production].[ProductListPriceHistory]

Object Name Owner Object Type Dep Level
  ufnGetProductDealerPrice  dbo  Function 
  ufnGetProductListPrice  dbo  Function 
Total: 2 object(s)

SQL

CREATE TABLE [ProductListPriceHistory] (
    [ProductID] [int] NOT NULL ,
    [StartDate] [datetime] NOT NULL ,
    [EndDate] [datetime] NULL ,
    [ListPrice] [money] NOT NULL ,
    [ModifiedDate] [datetime] NOT NULL CONSTRAINT [DF_ProductListPriceHistory_ModifiedDate] DEFAULT (getdate()),
    CONSTRAINT [PK_ProductListPriceHistory_ProductID_StartDate] PRIMARY KEY  CLUSTERED
    (
        [ProductID],
        [StartDate]
    )  ON [PRIMARY] ,
    CONSTRAINT [FK_ProductListPriceHistory_Product_ProductID] FOREIGN KEY
    (
        [ProductID]
    ) REFERENCES [Product] (
        [ProductID]
    ),
    CONSTRAINT [CK_ProductListPriceHistory_EndDate] CHECK ([EndDate]>=[StartDate] OR [EndDate] IS NULL),
    CONSTRAINT [CK_ProductListPriceHistory_ListPrice] CHECK ([ListPrice]>(0.00))
) ON [PRIMARY]
GO


See Also

List of tables