AdventureWorks
Sales.SalesReason Table
Description
Lookup table of customer purchase reasons.
Properties
Creation Date08/01/2010 08:40
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 SalesReasonIDPrimary key for SalesReason records.int4   
 NameSales reason description.dbo.Name50   
 ReasonTypeCategory the sales reason belongs to.dbo.Name50   
 ModifiedDateDate and time the record was last updated.datetime4 
(getdate())
 
Indexes
IndexDescriptionPrimaryUnique
PK_SalesReason_SalesReasonIDPrimary key (clustered) constraint
Relationships
RelationshipDescription
FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonIDForeign key constraint referencing SalesReason.SalesReasonID.
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

 

 


© 2012 All Rights Reserved.

Send comments on this topic.