Table: [AdventureWorks2016CTP3].[Purchasing].[ProductVendor]

CollapseAll image

Collapse image Table properties


Name  Value 
 Schema  [Purchasing]
 Owner  [dbo]
 Table is replicated   
 Creation date  23.10.2015
 ID  1042102753
 Located on  PRIMARY
 Data size KB  40 KB
 Index size KB  64 KB
 Rows  460
 ChangeTrackingEnabled   
 FileStreamFileGroup   
 FileStreamPartitionScheme   
 LockEscalation  TABLE
 TrackColumnsUpdatedEnabled   
 Table is filetable   
 Filetable directory   
 Filetable collate   
 Filetable primary key  [PK_ProductVendor_ProductID_BusinessEntityID]
 Filetable streamid unique   
 Filetable fullpath unique   
 Filetable is enabled   
 Is memory optimized   
 Durability  SCHEMA_AND_DATA

Collapse image Creation options


Name  Value 
QUOTED_IDENTIFIER ON
ANSI_NULLS ON
ANSI_PADDING ON

Collapse image Columns


    Name  Description  Data type  Max length  Nullable  Default IsGUID  SPARSE Computed value
Primary key Foreign key ProductID     int 4        
Primary key Foreign key BusinessEntityID     int 4        
    AverageLeadTime     int 4        
    StandardPrice     money 8        
    LastReceiptCost     money 8      
    LastReceiptDate     datetime 8      
    MinOrderQty     int 4        
    MaxOrderQty     int 4        
    OnOrderQty     int 4      
  Foreign key UnitMeasureCode     nchar 3        
    ModifiedDate     datetime 8   (getdate())    
Total: 11 column(s)

Collapse image Indexes


Index  Description  Primary  Unique  Size KB 
[PK_ProductVendor_ProductID_BusinessEntityID] ProductID   104 0
[IX_ProductVendor_BusinessEntityID] BusinessEntityID       16 0
[IX_ProductVendor_UnitMeasureCode] UnitMeasureCode       32 0
Total: 3 Index/indexes

Collapse image Columnstore indexes


No columnstore indexes exist

Collapse image Check constraints


Name  Expression 
CK_ProductVendor_AverageLeadTime ([AverageLeadTime]>=(1))
CK_ProductVendor_LastReceiptCost ([LastReceiptCost]>(0.00))
CK_ProductVendor_MaxOrderQty ([MaxOrderQty]>=(1))
CK_ProductVendor_MinOrderQty ([MinOrderQty]>=(1))
CK_ProductVendor_OnOrderQty ([OnOrderQty]>=(0))
CK_ProductVendor_StandardPrice ([StandardPrice]>(0.00))

Collapse image Referenced tables


Table  Primary key or unique constraint  Foreign key 
[Production].[Product] PK_Product_ProductID FK_ProductVendor_Product_ProductID
[Production].[UnitMeasure] PK_UnitMeasure_UnitMeasureCode FK_ProductVendor_UnitMeasure_UnitMeasureCode
[Purchasing].[Vendor] PK_Vendor_BusinessEntityID FK_ProductVendor_Vendor_BusinessEntityID
Total: 3 table(s)

Collapse image Objects that [Purchasing].[ProductVendor] depends on


Object name Object type Dep level
[Purchasing] Schema 1
[Production].[Product] Table 1
[Production].[UnitMeasure] Table 1
[Purchasing].[Vendor] Table 1
Total 4 object(s)

Collapse image Extended properties


Name  Value 
MS_Description Cross-reference table mapping vendors with the products they supply.

Collapse image Table options


Name  Value 
Pintable OFF
Table lock on bulk load OFF
Insert row lock OFF
Text in row 0
Large value types out of row OFF

Collapse image SQL


SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING ON
GO
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 [PK_ProductVendor_ProductID_BusinessEntityID]
        PRIMARY KEY
        CLUSTERED
        ([ProductID], [BusinessEntityID])
    ON [PRIMARY]
) ON [PRIMARY]
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'Clustered index created by a primary key constraint.', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'INDEX', N'PK_ProductVendor_ProductID_BusinessEntityID'
GO
ALTER TABLE [Purchasing].[ProductVendor]
    ADD
    CONSTRAINT [CK_ProductVendor_AverageLeadTime]
    CHECK
    ([AverageLeadTime]>=(1))
GO
EXEC sp_addextendedproperty N'MS_Description', N'Check constraint [AverageLeadTime] >= (1)', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'CONSTRAINT', N'CK_ProductVendor_AverageLeadTime'
GO
ALTER TABLE [Purchasing].[ProductVendor]
CHECK CONSTRAINT [CK_ProductVendor_AverageLeadTime]
GO
ALTER TABLE [Purchasing].[ProductVendor]
    ADD
    CONSTRAINT [CK_ProductVendor_LastReceiptCost]
    CHECK
    ([LastReceiptCost]>(0.00))
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
ALTER TABLE [Purchasing].[ProductVendor]
CHECK CONSTRAINT [CK_ProductVendor_LastReceiptCost]
GO
ALTER TABLE [Purchasing].[ProductVendor]
    ADD
    CONSTRAINT [CK_ProductVendor_MaxOrderQty]
    CHECK
    ([MaxOrderQty]>=(1))
GO
EXEC sp_addextendedproperty N'MS_Description', N'Check constraint [MaxOrderQty] >= (1)', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'CONSTRAINT', N'CK_ProductVendor_MaxOrderQty'
GO
ALTER TABLE [Purchasing].[ProductVendor]
CHECK CONSTRAINT [CK_ProductVendor_MaxOrderQty]
GO
ALTER TABLE [Purchasing].[ProductVendor]
    ADD
    CONSTRAINT [CK_ProductVendor_MinOrderQty]
    CHECK
    ([MinOrderQty]>=(1))
GO
EXEC sp_addextendedproperty N'MS_Description', N'Check constraint [MinOrderQty] >= (1)', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'CONSTRAINT', N'CK_ProductVendor_MinOrderQty'
GO
ALTER TABLE [Purchasing].[ProductVendor]
CHECK CONSTRAINT [CK_ProductVendor_MinOrderQty]
GO
ALTER TABLE [Purchasing].[ProductVendor]
    ADD
    CONSTRAINT [CK_ProductVendor_OnOrderQty]
    CHECK
    ([OnOrderQty]>=(0))
GO
EXEC sp_addextendedproperty N'MS_Description', N'Check constraint [OnOrderQty] >= (0)', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'CONSTRAINT', N'CK_ProductVendor_OnOrderQty'
GO
ALTER TABLE [Purchasing].[ProductVendor]
CHECK CONSTRAINT [CK_ProductVendor_OnOrderQty]
GO
ALTER TABLE [Purchasing].[ProductVendor]
    ADD
    CONSTRAINT [CK_ProductVendor_StandardPrice]
    CHECK
    ([StandardPrice]>(0.00))
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
ALTER TABLE [Purchasing].[ProductVendor]
CHECK CONSTRAINT [CK_ProductVendor_StandardPrice]
GO
ALTER TABLE [Purchasing].[ProductVendor]
    ADD
    CONSTRAINT [DF_ProductVendor_ModifiedDate]
    DEFAULT (getdate()) FOR [ModifiedDate]
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
ALTER TABLE [Purchasing].[ProductVendor]
    WITH CHECK
    ADD CONSTRAINT [FK_ProductVendor_Product_ProductID]
    FOREIGN KEY ([ProductID]) REFERENCES [Production].[Product] ([ProductID])
ALTER TABLE [Purchasing].[ProductVendor]
    CHECK CONSTRAINT [FK_ProductVendor_Product_ProductID]

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
ALTER TABLE [Purchasing].[ProductVendor]
    WITH CHECK
    ADD CONSTRAINT [FK_ProductVendor_UnitMeasure_UnitMeasureCode]
    FOREIGN KEY ([UnitMeasureCode]) REFERENCES [Production].[UnitMeasure] ([UnitMeasureCode])
ALTER TABLE [Purchasing].[ProductVendor]
    CHECK CONSTRAINT [FK_ProductVendor_UnitMeasure_UnitMeasureCode]

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
ALTER TABLE [Purchasing].[ProductVendor]
    WITH CHECK
    ADD CONSTRAINT [FK_ProductVendor_Vendor_BusinessEntityID]
    FOREIGN KEY ([BusinessEntityID]) REFERENCES [Purchasing].[Vendor] ([BusinessEntityID])
ALTER TABLE [Purchasing].[ProductVendor]
    CHECK CONSTRAINT [FK_ProductVendor_Vendor_BusinessEntityID]

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
CREATE NONCLUSTERED INDEX [IX_ProductVendor_BusinessEntityID]
    ON [Purchasing].[ProductVendor] ([BusinessEntityID])
    ON [PRIMARY]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Nonclustered index.', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', 'INDEX', N'IX_ProductVendor_BusinessEntityID'
GO
CREATE NONCLUSTERED INDEX [IX_ProductVendor_UnitMeasureCode]
    ON [Purchasing].[ProductVendor] ([UnitMeasureCode])
    ON [PRIMARY]
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'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'Cross-reference table mapping vendors with the products they supply.', 'SCHEMA', N'Purchasing', 'TABLE', N'ProductVendor', NULL, NULL
GO

Collapse image See also


List of tables