Purchasing.ProductVendor Table

Information

NameProductVendor
SchemaPurchasing
Row Count0
Data Size 
Index Size 
Reserved Size 
Unused Size 
Created29.3.2010. 21:58:18
Modified29.3.2010. 21:58:54

Extended Properties

NameTypeProperty NameValue
ProductVendorTABLEMS_DescriptionCross-reference table mapping vendors with the products they supply.

Columns

PKKeyIdentityNameData TypeAllow NullsCollationReferencesDefaultComputedCompute Expression
   ProductIDint  Production.Product.ProductID
 
 
 
   VendorIDint  Purchasing.Vendor.VendorID
 
 
 
   AverageLeadTimeint   
 
 
 
   StandardPricemoney   
 
 
 
   LastReceiptCostmoney   
 
 
 
   LastReceiptDatedatetime   
 
 
 
   MinOrderQtyint   
 
 
 
   MaxOrderQtyint   
 
 
 
   OnOrderQtyint   
 
 
 
   UnitMeasureCodenchar(3) SQL_Latin1_General_CP1_CI_ASProduction.UnitMeasure.UnitMeasureCode
 
 
 
   ModifiedDatedatetime   
(getdate())
 
 

Indexes

NameTypePrimaryUniqueColumns
PK_ProductVendor_ProductID_VendorIDClustered  ProductID, VendorID
IX_ProductVendor_UnitMeasureCodeNonClustered  UnitMeasureCode
IX_ProductVendor_VendorIDNonClustered  VendorID

Check Constraints

NameColumnEnabledTrustedExpression
CK_ProductVendor_AverageLeadTimeAverageLeadTime  ([AverageLeadTime]>=(1))
CK_ProductVendor_StandardPriceStandardPrice  ([StandardPrice]>(0.00))
CK_ProductVendor_LastReceiptCostLastReceiptCost  ([LastReceiptCost]>(0.00))
CK_ProductVendor_MinOrderQtyMinOrderQty  ([MinOrderQty]>=(1))
CK_ProductVendor_MaxOrderQtyMaxOrderQty  ([MaxOrderQty]>=(1))
CK_ProductVendor_OnOrderQtyOnOrderQty  ([OnOrderQty]>=(0))

Foreign Key Constraints

NameTypeReferenced Table
FK_ProductVendor_Product_ProductIDForeign keyProduction.Product
FK_ProductVendor_UnitMeasure_UnitMeasureCodeForeign keyProduction.UnitMeasure
FK_ProductVendor_Vendor_VendorIDForeign keyPurchasing.Vendor

SQL Script

CREATE TABLE [Purchasing].[ProductVendor] (
    [ProductID] int NOT NULL,
    [VendorID] 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) NOT NULL,
    [ModifiedDate] datetime NOT NULL DEFAULT (getdate())
);
CREATE INDEX [IX_ProductVendor_UnitMeasureCode] on [Purchasing].[ProductVendor]([UnitMeasureCode]);
CREATE INDEX [IX_ProductVendor_VendorID] on [Purchasing].[ProductVendor]([VendorID]);