AdventureWorks
Production.ScrapReason Table
Description
Manufacturing failure reasons lookup table.
Properties
Creation Date08/01/2010 08:40
File GroupPRIMARY
Text File Group
System Object
Published for Replication
Rows16
Data Space Used8.00 KB
Index Space Used24.00 KB
Columns
 Column NameDescriptionDatatypeLengthAllow NullsDefaultFormula
Primary Key ScrapReasonIDPrimary key for ScrapReason records.smallint2   
 NameFailure description.dbo.Name50   
 ModifiedDateDate and time the record was last updated.datetime4 
(getdate())
 
Indexes
IndexDescriptionPrimaryUnique
AK_ScrapReason_NameUnique nonclustered index. 
PK_ScrapReason_ScrapReasonIDPrimary key (clustered) constraint
Relationships
RelationshipDescription
FK_WorkOrder_ScrapReason_ScrapReasonIDForeign key constraint referencing ScrapReason.ScrapReasonID.
Objects that depend on Production.ScrapReason
 Database ObjectObject TypeDescriptionDep Level
iWorkOrder triggeriWorkOrderTriggerAFTER INSERT trigger that inserts a row in the TransactionHistory table.2
uWorkOrder triggeruWorkOrderTriggerAFTER UPDATE trigger that inserts a row in the TransactionHistory table, updates ModifiedDate in the WorkOrder table.2
Production.WorkOrder tableProduction.WorkOrderTableManufacturing work orders.1
Production.WorkOrderRouting tableProduction.WorkOrderRoutingTableWork order details.2
Objects that Production.ScrapReason 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 [Production].[ScrapReason](
	[ScrapReasonID] [smallint] IDENTITY(1,1) NOT NULL,
	[Name] [dbo].[Name] NOT NULL,
	[ModifiedDate] [datetime] NOT NULL,
 CONSTRAINT [PK_ScrapReason_ScrapReasonID] PRIMARY KEY CLUSTERED 
(
	[ScrapReasonID] 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 [Production].[ScrapReason] ADD  CONSTRAINT [DF_ScrapReason_ModifiedDate]  DEFAULT (getdate()) FOR [ModifiedDate]
See Also

Related Objects

Production Schema
AdventureWorks Database

 

 


© 2012 All Rights Reserved.

Send comments on this topic.