Production.BillOfMaterials Table

Information

NameBillOfMaterials
SchemaProduction
Row Count0
Data Size 
Index Size 
Reserved Size 
Unused Size 
Created29.3.2010. 21:58:18
Modified29.3.2010. 21:58:54

Extended Properties

NameTypeProperty NameValue
BillOfMaterialsTABLEMS_DescriptionItems required to make bicycles and bicycle subassemblies. It identifies the heirarchical relationship between a parent product and its components.

Columns

PKKeyIdentityNameData TypeAllow NullsCollationReferencesDefaultComputedCompute Expression
   BillOfMaterialsIDint   
 
 
 
   ProductAssemblyIDint  Production.Product.ProductID
 
 
 
   ComponentIDint  Production.Product.ProductID
 
 
 
   StartDatedatetime   
(getdate())
 
 
   EndDatedatetime   
 
 
 
   UnitMeasureCodenchar(3) SQL_Latin1_General_CP1_CI_ASProduction.UnitMeasure.UnitMeasureCode
 
 
 
   BOMLevelsmallint   
 
 
 
   PerAssemblyQtydecimal(8,2)   
((1.00))
 
 
   ModifiedDatedatetime   
(getdate())
 
 

Indexes

NameTypePrimaryUniqueColumns
AK_BillOfMaterials_ProductAssemblyID_ComponentID_StartDateClustered  ProductAssemblyID, ComponentID, StartDate
PK_BillOfMaterials_BillOfMaterialsIDNonClustered  BillOfMaterialsID
IX_BillOfMaterials_UnitMeasureCodeNonClustered  UnitMeasureCode

Check Constraints

NameColumnEnabledTrustedExpression
CK_BillOfMaterials_BOMLevel   ([ProductAssemblyID] IS NULL AND [BOMLevel]=(0) AND [PerAssemblyQty]=(1.00) OR [ProductAssemblyID] IS NOT NULL AND [BOMLevel]>=(1))
CK_BillOfMaterials_EndDate   ([EndDate]>[StartDate] OR [EndDate] IS NULL)
CK_BillOfMaterials_ProductAssemblyID   ([ProductAssemblyID]<>[ComponentID])
CK_BillOfMaterials_PerAssemblyQtyPerAssemblyQty  ([PerAssemblyQty]>=(1.00))

Foreign Key Constraints

NameTypeReferenced Table
FK_BillOfMaterials_Product_ComponentIDForeign keyProduction.Product
FK_BillOfMaterials_Product_ProductAssemblyIDForeign keyProduction.Product
FK_BillOfMaterials_UnitMeasure_UnitMeasureCodeForeign keyProduction.UnitMeasure

SQL Script

CREATE TABLE [Production].[BillOfMaterials] (
    [BillOfMaterialsID] int NOT NULL IDENTITY,
    [ProductAssemblyID] int NULL,
    [ComponentID] int NOT NULL,
    [StartDate] datetime NOT NULL DEFAULT (getdate()),
    [EndDate] datetime NULL,
    [UnitMeasureCode] nchar(3) NOT NULL,
    [BOMLevel] smallint NOT NULL,
    [PerAssemblyQty] decimal(8,2) NOT NULL DEFAULT ((1.00)),
    [ModifiedDate] datetime NOT NULL DEFAULT (getdate())
);
CREATE UNIQUE INDEX [AK_BillOfMaterials_ProductAssemblyID_ComponentID_StartDate] on [Production].[BillOfMaterials]([ProductAssemblyID], [ComponentID], [StartDate]);
CREATE INDEX [IX_BillOfMaterials_UnitMeasureCode] on [Production].[BillOfMaterials]([UnitMeasureCode]);