Table: [AdventureWorks2016CTP3].[Sales].[SalesReason]

CollapseAll image

Collapse image Table properties


Name  Value 
 Schema  [Sales]
 Owner  [dbo]
 Table is replicated   
 Creation date  23.10.2015
 ID  2130106629
 Located on  PRIMARY
 Data size KB  8 KB
 Index size KB  8 KB
 Rows  10
 ChangeTrackingEnabled   
 FileStreamFileGroup   
 FileStreamPartitionScheme   
 LockEscalation  TABLE
 TrackColumnsUpdatedEnabled   
 Table is filetable   
 Filetable directory   
 Filetable collate   
 Filetable primary key  [PK_SalesReason_SalesReasonID]
 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 Identity SalesReasonID     int 4        
    Name     [dbo].[Name] 50        
    ReasonType     [dbo].[Name] 50        
    ModifiedDate     datetime 8   (getdate())    
Total: 4 column(s)

Collapse image Indexes


Index  Description  Primary  Unique  Size KB 
[PK_SalesReason_SalesReasonID] SalesReasonID   16 0
Total: 1 Index/indexes

Collapse image Columnstore indexes


No columnstore indexes exist

Collapse image Identity column


  Name  Seed  Increment  Not for replication 
 SalesReasonID   1   1   

Collapse image Referencing tables


Table  Foreign key  Primary key or unique constraint 
[Sales].[SalesOrderHeaderSalesReason] FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID PK_SalesReason_SalesReasonID
Total: 1 table(s)

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


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

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


Object name Object type Dep level
[Sales] Schema 1
[dbo].[Name] Datatype 1
Total 2 object(s)

Collapse image Extended properties


Name  Value 
MS_Description Lookup table of customer purchase reasons.

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 [Sales].[SalesReason] (
        [SalesReasonID]     [int] IDENTITY(1, 1) NOT NULL,
        [Name]              [dbo].[Name] NOT NULL,
        [ReasonType]        [dbo].[Name] NOT NULL,
        [ModifiedDate]      [datetime] NOT NULL,
        CONSTRAINT [PK_SalesReason_SalesReasonID]
        PRIMARY KEY
        CLUSTERED
        ([SalesReasonID])
    ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Primary key (clustered) constraint', 'SCHEMA', N'Sales', 'TABLE', N'SalesReason', 'CONSTRAINT', N'PK_SalesReason_SalesReasonID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Clustered index created by a primary key constraint.', 'SCHEMA', N'Sales', 'TABLE', N'SalesReason', 'INDEX', N'PK_SalesReason_SalesReasonID'
GO
ALTER TABLE [Sales].[SalesReason]
    ADD
    CONSTRAINT [DF_SalesReason_ModifiedDate]
    DEFAULT (getdate()) FOR [ModifiedDate]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Default constraint value of GETDATE()', 'SCHEMA', N'Sales', 'TABLE', N'SalesReason', 'CONSTRAINT', N'DF_SalesReason_ModifiedDate'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Date and time the record was last updated.', 'SCHEMA', N'Sales', 'TABLE', N'SalesReason', 'COLUMN', N'ModifiedDate'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Sales reason description.', 'SCHEMA', N'Sales', 'TABLE', N'SalesReason', 'COLUMN', N'Name'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Category the sales reason belongs to.', 'SCHEMA', N'Sales', 'TABLE', N'SalesReason', 'COLUMN', N'ReasonType'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Primary key for SalesReason records.', 'SCHEMA', N'Sales', 'TABLE', N'SalesReason', 'COLUMN', N'SalesReasonID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Lookup table of customer purchase reasons.', 'SCHEMA', N'Sales', 'TABLE', N'SalesReason', NULL, NULL
GO

Collapse image See also


List of tables