Northwind Database (Document! X Sample)
Sales.SalesReason Table
AdventureWorks Database > Sales Schema : Sales.SalesReason Table
Description
Lookup table of customer purchase reasons.
Properties
Creation Date27/10/2017 14:33
File GroupPRIMARY
Text File Group
System Object
Published for Replication
Rows10
Data Space Used8.00 KB
Index Space Used8.00 KB
Columns
 Column NameDescriptionDatatypeLengthAllow NullsDefaultFormula
Primary Key Primary key for SalesReason records.Integer4   
 Sales reason description.dbo.Name50   
 Category the sales reason belongs to.dbo.Name50   
 Date and time the record was last updated.DBTimeStamp4 
(getdate())
 
Indexes
IndexDescriptionPrimaryUnique
Primary key (clustered) constraint
Objects that depend on Sales.SalesReason
 Database ObjectObject TypeDescriptionDep Level
Sales.SalesOrderHeaderSalesReason tableSales.SalesOrderHeaderSalesReasonTableCross-reference table mapping sales orders to sales reason codes.1
Objects that Sales.SalesReason depends on
 Database ObjectObject TypeDescriptionDep Level
dbo.Name datatypedbo.NameUser Defined Data Type 1
SQL
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
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] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

ALTER TABLE [Sales].[SalesReason] ADD  CONSTRAINT [DF_SalesReason_ModifiedDate]  DEFAULT (getdate()) FOR [ModifiedDate]
See Also

Related Objects

Sales Schema
AdventureWorks Database