Table: [AdventureWorks2016CTP3].[Sales].[SpecialOfferProduct]

CollapseAll image

Collapse image Table properties


Name  Value 
 Schema  [Sales]
 Owner  [dbo]
 Table is replicated   
 Creation date  23.10.2015
 ID  734625660
 Located on  PRIMARY
 Data size KB  24 KB
 Index size KB  64 KB
 Rows  538
 ChangeTrackingEnabled   
 FileStreamFileGroup   
 FileStreamPartitionScheme   
 LockEscalation  TABLE
 TrackColumnsUpdatedEnabled   
 Table is filetable   
 Filetable directory   
 Filetable collate   
 Filetable primary key  [PK_SpecialOfferProduct_SpecialOfferID_ProductID]
 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 OFF

Collapse image Columns


    Name  Description  Data type  Max length  Nullable  Default IsGUID  SPARSE Computed value
Primary key Foreign key SpecialOfferID     int 4        
Primary key Foreign key ProductID     int 4        
    rowguid     uniqueidentifier 16   (newid())  
    ModifiedDate     datetime 8   (getdate())    
Total: 4 column(s)

Collapse image Indexes


Index  Description  Primary  Unique  Size KB 
[PK_SpecialOfferProduct_SpecialOfferID_ProductID] SpecialOfferID   88 0
[AK_SpecialOfferProduct_rowguid] rowguid     32 0
[IX_SpecialOfferProduct_ProductID] ProductID       16 0
Total: 3 Index/indexes

Collapse image Columnstore indexes


No columnstore indexes exist

Collapse image Referencing tables


Table  Foreign key  Primary key or unique constraint 
[Sales].[SalesOrderDetail] FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID PK_SpecialOfferProduct_SpecialOfferID_ProductID
Total: 1 table(s)

Collapse image Referenced tables


Table  Primary key or unique constraint  Foreign key 
[Production].[Product] PK_Product_ProductID FK_SpecialOfferProduct_Product_ProductID
[Sales].[SpecialOffer] PK_SpecialOffer_SpecialOfferID FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID
Total: 2 table(s)

Collapse image Objects that depend on [Sales].[SpecialOfferProduct]


Object name Object type Dep level
[Sales].[SalesOrderDetail] Table 1
Total 1 object(s)

Collapse image Objects that [Sales].[SpecialOfferProduct] depends on


Object name Object type Dep level
[Sales] Schema 1
[Production].[Product] Table 1
[Sales].[SpecialOffer] Table 1
Total 3 object(s)

Collapse image Extended properties


Name  Value 
MS_Description Cross-reference table mapping products to special offer discounts.

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 OFF
GO
CREATE TABLE [Sales].[SpecialOfferProduct] (
        [SpecialOfferID]     [int] NOT NULL,
        [ProductID]          [int] NOT NULL,
        [rowguid]            [uniqueidentifier] NOT NULL ROWGUIDCOL,
        [ModifiedDate]       [datetime] NOT NULL,
        CONSTRAINT [PK_SpecialOfferProduct_SpecialOfferID_ProductID]
        PRIMARY KEY
        CLUSTERED
        ([SpecialOfferID], [ProductID])
    ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Primary key (clustered) constraint', 'SCHEMA', N'Sales', 'TABLE', N'SpecialOfferProduct', 'CONSTRAINT', N'PK_SpecialOfferProduct_SpecialOfferID_ProductID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Clustered index created by a primary key constraint.', 'SCHEMA', N'Sales', 'TABLE', N'SpecialOfferProduct', 'INDEX', N'PK_SpecialOfferProduct_SpecialOfferID_ProductID'
GO
ALTER TABLE [Sales].[SpecialOfferProduct]
    ADD
    CONSTRAINT [DF_SpecialOfferProduct_ModifiedDate]
    DEFAULT (getdate()) FOR [ModifiedDate]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Default constraint value of GETDATE()', 'SCHEMA', N'Sales', 'TABLE', N'SpecialOfferProduct', 'CONSTRAINT', N'DF_SpecialOfferProduct_ModifiedDate'
GO
ALTER TABLE [Sales].[SpecialOfferProduct]
    ADD
    CONSTRAINT [DF_SpecialOfferProduct_rowguid]
    DEFAULT (newid()) FOR [rowguid]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Default constraint value of NEWID()', 'SCHEMA', N'Sales', 'TABLE', N'SpecialOfferProduct', 'CONSTRAINT', N'DF_SpecialOfferProduct_rowguid'
GO
ALTER TABLE [Sales].[SpecialOfferProduct]
    WITH CHECK
    ADD CONSTRAINT [FK_SpecialOfferProduct_Product_ProductID]
    FOREIGN KEY ([ProductID]) REFERENCES [Production].[Product] ([ProductID])
ALTER TABLE [Sales].[SpecialOfferProduct]
    CHECK CONSTRAINT [FK_SpecialOfferProduct_Product_ProductID]

GO
EXEC sp_addextendedproperty N'MS_Description', N'Foreign key constraint referencing Product.ProductID.', 'SCHEMA', N'Sales', 'TABLE', N'SpecialOfferProduct', 'CONSTRAINT', N'FK_SpecialOfferProduct_Product_ProductID'
GO
ALTER TABLE [Sales].[SpecialOfferProduct]
    WITH CHECK
    ADD CONSTRAINT [FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID]
    FOREIGN KEY ([SpecialOfferID]) REFERENCES [Sales].[SpecialOffer] ([SpecialOfferID])
ALTER TABLE [Sales].[SpecialOfferProduct]
    CHECK CONSTRAINT [FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID]

GO
EXEC sp_addextendedproperty N'MS_Description', N'Foreign key constraint referencing SpecialOffer.SpecialOfferID.', 'SCHEMA', N'Sales', 'TABLE', N'SpecialOfferProduct', 'CONSTRAINT', N'FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID'
GO
CREATE UNIQUE NONCLUSTERED INDEX [AK_SpecialOfferProduct_rowguid]
    ON [Sales].[SpecialOfferProduct] ([rowguid])
    ON [PRIMARY]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Unique nonclustered index. Used to support replication samples.', 'SCHEMA', N'Sales', 'TABLE', N'SpecialOfferProduct', 'INDEX', N'AK_SpecialOfferProduct_rowguid'
GO
CREATE NONCLUSTERED INDEX [IX_SpecialOfferProduct_ProductID]
    ON [Sales].[SpecialOfferProduct] ([ProductID])
    ON [PRIMARY]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Nonclustered index.', 'SCHEMA', N'Sales', 'TABLE', N'SpecialOfferProduct', 'INDEX', N'IX_SpecialOfferProduct_ProductID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Date and time the record was last updated.', 'SCHEMA', N'Sales', 'TABLE', N'SpecialOfferProduct', 'COLUMN', N'ModifiedDate'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Product identification number. Foreign key to Product.ProductID.', 'SCHEMA', N'Sales', 'TABLE', N'SpecialOfferProduct', 'COLUMN', N'ProductID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.', 'SCHEMA', N'Sales', 'TABLE', N'SpecialOfferProduct', 'COLUMN', N'rowguid'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Primary key for SpecialOfferProduct records.', 'SCHEMA', N'Sales', 'TABLE', N'SpecialOfferProduct', 'COLUMN', N'SpecialOfferID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Cross-reference table mapping products to special offer discounts.', 'SCHEMA', N'Sales', 'TABLE', N'SpecialOfferProduct', NULL, NULL
GO

Collapse image See also


List of tables