• lsrep17 Documentation
  • Tables [Purchasing].[ProductVendor]
    Cross-reference table mapping vendors with the products they supply.
    PropertyValue
    CollationSQL_Latin1_General_CP1_CI_AS
    Row Count (~)460
    Created13:14:19 14 marca 2012
    Last Modified13:14:54 14 marca 2012
    KeyNameData TypeMax Length (Bytes)Allow NullsDefaultDescription
    Cluster Primary Key PK_ProductVendor_ProductID_BusinessEntityID: ProductID\BusinessEntityIDForeign Keys FK_ProductVendor_Product_ProductID: [Production].[Product].ProductIDProductIDint4
    False
    Primary key. Foreign key to Product.ProductID.
    Cluster Primary Key PK_ProductVendor_ProductID_BusinessEntityID: ProductID\BusinessEntityIDIndexes IX_ProductVendor_BusinessEntityIDForeign Keys FK_ProductVendor_Vendor_BusinessEntityID: [Purchasing].[Vendor].BusinessEntityIDBusinessEntityIDint4
    False
    Primary key. Foreign key to Vendor.BusinessEntityID.
    Check Constraints CK_ProductVendor_AverageLeadTime : ([AverageLeadTime]>=(1))AverageLeadTimeint4
    False
    The average span of time (in days) between placing an order with the vendor and receiving the purchased product.
    Check Constraints CK_ProductVendor_StandardPrice : ([StandardPrice]>(0.00))StandardPricemoney8
    False
    The vendor's usual selling price.
    Check Constraints CK_ProductVendor_LastReceiptCost : ([LastReceiptCost]>(0.00))LastReceiptCostmoney8
    True
    The selling price when last purchased.
    LastReceiptDatedatetime8
    True
    Date the product was last received by the vendor.
    Check Constraints CK_ProductVendor_MinOrderQty : ([MinOrderQty]>=(1))MinOrderQtyint4
    False
    The maximum quantity that should be ordered.
    Check Constraints CK_ProductVendor_MaxOrderQty : ([MaxOrderQty]>=(1))MaxOrderQtyint4
    False
    The minimum quantity that should be ordered.
    Check Constraints CK_ProductVendor_OnOrderQty : ([OnOrderQty]>=(0))OnOrderQtyint4
    True
    The quantity currently on order.
    Indexes IX_ProductVendor_UnitMeasureCodeForeign Keys FK_ProductVendor_UnitMeasure_UnitMeasureCode: [Production].[UnitMeasure].UnitMeasureCodeUnitMeasureCodenchar(3)6
    False
    The product's unit of measure.
    ModifiedDatedatetime8
    False
    (getdate())Date and time the record was last updated.
    KeyNameKey ColumnsUniqueDescription
    Cluster Primary Key PK_ProductVendor_ProductID_BusinessEntityID: ProductID\BusinessEntityIDPK_ProductVendor_ProductID_BusinessEntityIDProductID, BusinessEntityID
    True
    Primary key (clustered) constraint
    IX_ProductVendor_BusinessEntityIDBusinessEntityIDNonclustered index.
    IX_ProductVendor_UnitMeasureCodeUnitMeasureCodeNonclustered index.
    NameOn ColumnConstraintDescription
    CK_ProductVendor_AverageLeadTimeAverageLeadTime([AverageLeadTime]>=(1))Check constraint [AverageLeadTime] >= (1)
    CK_ProductVendor_LastReceiptCostLastReceiptCost([LastReceiptCost]>(0.00))Check constraint [LastReceiptCost] > (0.00)
    CK_ProductVendor_MaxOrderQtyMaxOrderQty([MaxOrderQty]>=(1))Check constraint [MaxOrderQty] >= (1)
    CK_ProductVendor_MinOrderQtyMinOrderQty([MinOrderQty]>=(1))Check constraint [MinOrderQty] >= (1)
    CK_ProductVendor_OnOrderQtyOnOrderQty([OnOrderQty]>=(0))Check constraint [OnOrderQty] >= (0)
    CK_ProductVendor_StandardPriceStandardPrice([StandardPrice]>(0.00))Check constraint [StandardPrice] > (0.00)
    NameColumnsDescription
    FK_ProductVendor_Product_ProductIDProductID->[Production].[Product].[ProductID]Foreign key constraint referencing Product.ProductID.
    FK_ProductVendor_UnitMeasure_UnitMeasureCodeUnitMeasureCode->[Production].[UnitMeasure].[UnitMeasureCode]Foreign key constraint referencing UnitMeasure.UnitMeasureCode.
    FK_ProductVendor_Vendor_BusinessEntityIDBusinessEntityID->[Purchasing].[Vendor].[BusinessEntityID]Foreign key constraint referencing Vendor.BusinessEntityID.
    CREATE TABLE [Purchasing].[ProductVendor]
    (
    [ProductID] [int] NOT NULL,
    [BusinessEntityID] [int] NOT NULL,
    [AverageLeadTime] [int] NOT NULL,
    [StandardPrice] [money] NOT NULL,
    [LastReceiptCost] [money] NULL,
    [LastReceiptDate] [datetime] NULL,
    [MinOrderQty] [int] NOT NULL,
    [MaxOrderQty] [int] NOT NULL,
    [OnOrderQty] [int] NULL,
    [UnitMeasureCode] [nchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
    [ModifiedDate] [datetime] NOT NULL CONSTRAINT [DF_ProductVendor_ModifiedDate] DEFAULT (getdate())
    ) ON [PRIMARY]
    GO
    ALTER TABLE [Purchasing].[ProductVendor] ADD CONSTRAINT [CK_ProductVendor_AverageLeadTime] CHECK (([AverageLeadTime]>=(1)))
    GO
    ALTER TABLE [Purchasing].[ProductVendor] ADD CONSTRAINT [CK_ProductVendor_LastReceiptCost] CHECK (([LastReceiptCost]>(0.00)))
    GO
    ALTER TABLE [Purchasing].[ProductVendor] ADD CONSTRAINT [CK_ProductVendor_MaxOrderQty] CHECK (([MaxOrderQty]>=(1)))
    GO
    ALTER TABLE [Purchasing].[ProductVendor] ADD CONSTRAINT [CK_ProductVendor_MinOrderQty] CHECK (([MinOrderQty]>=(1)))
    GO
    ALTER TABLE [Purchasing].[ProductVendor] ADD CONSTRAINT [CK_ProductVendor_OnOrderQty] CHECK (([OnOrderQty]>=(0)))
    GO
    ALTER TABLE [Purchasing].[ProductVendor] ADD CONSTRAINT [CK_ProductVendor_StandardPrice] CHECK (([StandardPrice]>(0.00)))
    GO
    ALTER TABLE [Purchasing].[ProductVendor] ADD CONSTRAINT [PK_ProductVendor_ProductID_BusinessEntityID] PRIMARY KEY CLUSTERED  ([ProductID], [BusinessEntityID]) ON [PRIMARY]
    GO
    CREATE NONCLUSTERED INDEX [IX_ProductVendor_BusinessEntityID] ON [Purchasing].[ProductVendor] ([BusinessEntityID]) ON [PRIMARY]
    GO
    CREATE NONCLUSTERED INDEX [IX_ProductVendor_UnitMeasureCode] ON [Purchasing].[ProductVendor] ([UnitMeasureCode]) ON [PRIMARY]
    GO
    ALTER TABLE [Purchasing].[ProductVendor] ADD CONSTRAINT [FK_ProductVendor_Product_ProductID] FOREIGN KEY ([ProductID]) REFERENCES [Production].[Product] ([ProductID])
    GO
    ALTER TABLE [Purchasing].[ProductVendor] ADD CONSTRAINT [FK_ProductVendor_UnitMeasure_UnitMeasureCode] FOREIGN KEY ([UnitMeasureCode]) REFERENCES [Production].[UnitMeasure] ([UnitMeasureCode])
    GO
    ALTER TABLE [Purchasing].[ProductVendor] ADD CONSTRAINT [FK_ProductVendor_Vendor_BusinessEntityID] FOREIGN KEY ([BusinessEntityID]) REFERENCES [Purchasing].[Vendor] ([BusinessEntityID])
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'Cross-reference table mapping vendors with the products they supply.', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', NULL, NULL
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'The average span of time (in days) between placing an order with the vendor and receiving the purchased product.', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'COLUMN', N'AverageLeadTime'
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'Primary key. Foreign key to Vendor.BusinessEntityID.', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'COLUMN', N'BusinessEntityID'
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'The selling price when last purchased.', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'COLUMN', N'LastReceiptCost'
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'Date the product was last received by the vendor.', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'COLUMN', N'LastReceiptDate'
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'The minimum quantity that should be ordered.', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'COLUMN', N'MaxOrderQty'
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'The maximum quantity that should be ordered.', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'COLUMN', N'MinOrderQty'
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'Date and time the record was last updated.', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'COLUMN', N'ModifiedDate'
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'The quantity currently on order.', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'COLUMN', N'OnOrderQty'
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'Primary key. Foreign key to Product.ProductID.', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'COLUMN', N'ProductID'
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'The vendor''s usual selling price.', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'COLUMN', N'StandardPrice'
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'The product''s unit of measure.', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'COLUMN', N'UnitMeasureCode'
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'Check constraint [AverageLeadTime] >= (1)', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'CONSTRAINT', N'CK_ProductVendor_AverageLeadTime'
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'Check constraint [LastReceiptCost] > (0.00)', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'CONSTRAINT', N'CK_ProductVendor_LastReceiptCost'
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'Check constraint [MaxOrderQty] >= (1)', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'CONSTRAINT', N'CK_ProductVendor_MaxOrderQty'
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'Check constraint [MinOrderQty] >= (1)', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'CONSTRAINT', N'CK_ProductVendor_MinOrderQty'
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'Check constraint [OnOrderQty] >= (0)', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'CONSTRAINT', N'CK_ProductVendor_OnOrderQty'
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'Check constraint [StandardPrice] > (0.00)', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'CONSTRAINT', N'CK_ProductVendor_StandardPrice'
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'Default constraint value of GETDATE()', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'CONSTRAINT', N'DF_ProductVendor_ModifiedDate'
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'Foreign key constraint referencing Product.ProductID.', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'CONSTRAINT', N'FK_ProductVendor_Product_ProductID'
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'Foreign key constraint referencing UnitMeasure.UnitMeasureCode.', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'CONSTRAINT', N'FK_ProductVendor_UnitMeasure_UnitMeasureCode'
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'Foreign key constraint referencing Vendor.BusinessEntityID.', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'CONSTRAINT', N'FK_ProductVendor_Vendor_BusinessEntityID'
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'Primary key (clustered) constraint', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'CONSTRAINT', N'PK_ProductVendor_ProductID_BusinessEntityID'
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'Nonclustered index.', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'INDEX', N'IX_ProductVendor_BusinessEntityID'
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'Nonclustered index.', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'INDEX', N'IX_ProductVendor_UnitMeasureCode'
    GO
    EXEC sp_addextendedproperty N'MS_Description', N'Clustered index created by a primary key constraint.', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'INDEX', N'PK_ProductVendor_ProductID_BusinessEntityID'
    GO