Production.ProductListPriceHistory Table
In This Topic
Description
Changes in the list price of a product over time.
Properties
Creation Date | 27/10/2017 14:33 |
File Group | PRIMARY |
Text File Group | |
System Object |  |
Published for Replication |  |
Rows | 395 |
Data Space Used | 24.00 KB |
Index Space Used | 16.00 KB |
Columns
| Column Name | Description | Datatype | Length | Allow Nulls | Default | Formula |
| ProductID | Product identification number. Foreign key to Product.ProductID | Integer | 4 | | | |
| StartDate | List price start date. | DBTimeStamp | 4 | | | |
| EndDate | List price end date | DBTimeStamp | 4 |  | | |
| ListPrice | Product list price. | Currency | 8 | | | |
| ModifiedDate | Date and time the record was last updated. | DBTimeStamp | 4 | | (getdate()) | |
Indexes
Check Constraints
Name | Description | Expression |
CK_ProductListPriceHistory_EndDate | Check constraint [EndDate] >= [StartDate] OR [EndDate] IS NULL | ([EndDate]>=[StartDate] OR [EndDate] IS NULL) |
CK_ProductListPriceHistory_ListPrice | Check constraint [ListPrice] > (0.00) | ([ListPrice]>(0.00)) |
Relationships
Objects that depend on Production.ProductListPriceHistory
| Database Object | Object Type | Description | Dep Level |
 | dbo.ufnGetProductDealerPrice | User Defined Function | Scalar function returning the dealer price for a given product on a particular order date. | 2 |
 | dbo.ufnGetProductListPrice | User Defined Function | Scalar function returning the list price for a given product on a particular order date. | 2 |
Objects that Production.ProductListPriceHistory depends on
SQL
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [Production].[ProductListPriceHistory](
[ProductID] [int] NOT NULL,
[StartDate] [datetime] NOT NULL,
[EndDate] [datetime] NULL,
[ListPrice] [money] NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_ProductListPriceHistory_ProductID_StartDate] PRIMARY KEY CLUSTERED
(
[ProductID] ASC,
[StartDate] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
ALTER TABLE [Production].[ProductListPriceHistory] ADD CONSTRAINT [DF_ProductListPriceHistory_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate]
ALTER TABLE [Production].[ProductListPriceHistory] WITH CHECK ADD CONSTRAINT [FK_ProductListPriceHistory_Product_ProductID] FOREIGN KEY([ProductID])
REFERENCES [Production].[Product] ([ProductID])
ALTER TABLE [Production].[ProductListPriceHistory] CHECK CONSTRAINT [FK_ProductListPriceHistory_Product_ProductID]
ALTER TABLE [Production].[ProductListPriceHistory] WITH CHECK ADD CONSTRAINT [CK_ProductListPriceHistory_EndDate] CHECK (([EndDate]>=[StartDate] OR [EndDate] IS NULL))
ALTER TABLE [Production].[ProductListPriceHistory] CHECK CONSTRAINT [CK_ProductListPriceHistory_EndDate]
ALTER TABLE [Production].[ProductListPriceHistory] WITH CHECK ADD CONSTRAINT [CK_ProductListPriceHistory_ListPrice] CHECK (([ListPrice]>(0.00)))
ALTER TABLE [Production].[ProductListPriceHistory] CHECK CONSTRAINT [CK_ProductListPriceHistory_ListPrice]
|
See Also