Overview

1 AdventureWorks © Matthias Wolf; wolf online training Hover columns to read comments. Production Sales Person HumanResources Purchasing dbo Fk FK_Address_StateProvince_StateProvinceID Address ref StateProvince ( StateProvinceID ) Fk FK_Address_StateProvince_StateProvinceID Address ref StateProvince ( StateProvinceID ) Fk FK_BillOfMaterials_Product_ComponentID BillOfMaterials ref Product ( ComponentID -> ProductID ) Fk FK_BillOfMaterials_Product_ComponentID BillOfMaterials ref Product ( ComponentID -> ProductID ) Fk FK_BillOfMaterials_Product_ProductAssemblyID BillOfMaterials ref Product ( ProductAssemblyID -> ProductID ) Fk FK_BillOfMaterials_Product_ProductAssemblyID BillOfMaterials ref Product ( ProductAssemblyID -> ProductID ) Fk FK_BillOfMaterials_UnitMeasure_UnitMeasureCode BillOfMaterials ref UnitMeasure ( UnitMeasureCode ) Fk FK_BillOfMaterials_UnitMeasure_UnitMeasureCode BillOfMaterials ref UnitMeasure ( UnitMeasureCode ) Fk FK_BusinessEntityAddress_AddressType_AddressTypeID BusinessEntityAddress ref AddressType ( AddressTypeID ) Fk FK_BusinessEntityAddress_AddressType_AddressTypeID BusinessEntityAddress ref AddressType ( AddressTypeID ) Fk FK_BusinessEntityAddress_BusinessEntity_BusinessEntityID BusinessEntityAddress ref BusinessEntity ( BusinessEntityID ) Fk FK_BusinessEntityAddress_BusinessEntity_BusinessEntityID BusinessEntityAddress ref BusinessEntity ( BusinessEntityID ) Fk FK_BusinessEntityContact_BusinessEntity_BusinessEntityID BusinessEntityContact ref BusinessEntity ( BusinessEntityID ) Fk FK_BusinessEntityContact_BusinessEntity_BusinessEntityID BusinessEntityContact ref BusinessEntity ( BusinessEntityID ) Fk FK_BusinessEntityContact_ContactType_ContactTypeID BusinessEntityContact ref ContactType ( ContactTypeID ) Fk FK_BusinessEntityContact_ContactType_ContactTypeID BusinessEntityContact ref ContactType ( ContactTypeID ) Fk FK_BusinessEntityContact_Person_PersonID BusinessEntityContact ref Person ( PersonID -> BusinessEntityID ) Fk FK_BusinessEntityContact_Person_PersonID BusinessEntityContact ref Person ( PersonID -> BusinessEntityID ) Fk FK_CountryRegionCurrency_CountryRegion_CountryRegionCode CountryRegionCurrency ref CountryRegion ( CountryRegionCode ) Fk FK_CountryRegionCurrency_CountryRegion_CountryRegionCode CountryRegionCurrency ref CountryRegion ( CountryRegionCode ) Fk FK_CountryRegionCurrency_Currency_CurrencyCode CountryRegionCurrency ref Currency ( CurrencyCode ) Fk FK_CountryRegionCurrency_Currency_CurrencyCode CountryRegionCurrency ref Currency ( CurrencyCode ) Fk FK_CurrencyRate_Currency_FromCurrencyCode CurrencyRate ref Currency ( FromCurrencyCode -> CurrencyCode ) Fk FK_CurrencyRate_Currency_FromCurrencyCode CurrencyRate ref Currency ( FromCurrencyCode -> CurrencyCode ) Fk FK_CurrencyRate_Currency_ToCurrencyCode CurrencyRate ref Currency ( ToCurrencyCode -> CurrencyCode ) Fk FK_CurrencyRate_Currency_ToCurrencyCode CurrencyRate ref Currency ( ToCurrencyCode -> CurrencyCode ) Fk FK_Customer_Person_PersonID Customer ref Person ( PersonID -> BusinessEntityID ) Fk FK_Customer_Person_PersonID Customer ref Person ( PersonID -> BusinessEntityID ) Fk FK_Customer_SalesTerritory_TerritoryID Customer ref SalesTerritory ( TerritoryID ) Fk FK_Customer_SalesTerritory_TerritoryID Customer ref SalesTerritory ( TerritoryID ) Fk FK_Customer_Store_StoreID Customer ref Store ( StoreID -> BusinessEntityID ) Fk FK_Customer_Store_StoreID Customer ref Store ( StoreID -> BusinessEntityID ) Fk FK_Document_Employee_Owner Document ref Employee ( Owner -> BusinessEntityID ) Fk FK_Document_Employee_Owner Document ref Employee ( Owner -> BusinessEntityID ) Fk FK_EmailAddress_Person_BusinessEntityID EmailAddress ref Person ( BusinessEntityID ) Fk FK_EmailAddress_Person_BusinessEntityID EmailAddress ref Person ( BusinessEntityID ) Fk FK_Employee_Person_BusinessEntityID Employee ref Person ( BusinessEntityID ) Fk FK_Employee_Person_BusinessEntityID Employee ref Person ( BusinessEntityID ) Fk FK_EmployeeDepartmentHistory_Department_DepartmentID EmployeeDepartmentHistory ref Department ( DepartmentID ) Fk FK_EmployeeDepartmentHistory_Department_DepartmentID EmployeeDepartmentHistory ref Department ( DepartmentID ) Fk FK_EmployeeDepartmentHistory_Employee_BusinessEntityID EmployeeDepartmentHistory ref Employee ( BusinessEntityID ) Fk FK_EmployeeDepartmentHistory_Employee_BusinessEntityID EmployeeDepartmentHistory ref Employee ( BusinessEntityID ) Fk FK_EmployeeDepartmentHistory_Shift_ShiftID EmployeeDepartmentHistory ref Shift ( ShiftID ) Fk FK_EmployeeDepartmentHistory_Shift_ShiftID EmployeeDepartmentHistory ref Shift ( ShiftID ) Fk FK_EmployeePayHistory_Employee_BusinessEntityID EmployeePayHistory ref Employee ( BusinessEntityID ) Fk FK_EmployeePayHistory_Employee_BusinessEntityID EmployeePayHistory ref Employee ( BusinessEntityID ) Fk FK_JobCandidate_Employee_BusinessEntityID JobCandidate ref Employee ( BusinessEntityID ) Fk FK_JobCandidate_Employee_BusinessEntityID JobCandidate ref Employee ( BusinessEntityID ) Fk FK_Password_Person_BusinessEntityID Password ref Person ( BusinessEntityID ) Fk FK_Password_Person_BusinessEntityID Password ref Person ( BusinessEntityID ) Fk FK_PersonCreditCard_CreditCard_CreditCardID PersonCreditCard ref CreditCard ( CreditCardID ) Fk FK_PersonCreditCard_CreditCard_CreditCardID PersonCreditCard ref CreditCard ( CreditCardID ) Fk FK_PersonCreditCard_Person_BusinessEntityID PersonCreditCard ref Person ( BusinessEntityID ) Fk FK_PersonCreditCard_Person_BusinessEntityID PersonCreditCard ref Person ( BusinessEntityID ) Fk FK_PersonPhone_Person_BusinessEntityID PersonPhone ref Person ( BusinessEntityID ) Fk FK_PersonPhone_Person_BusinessEntityID PersonPhone ref Person ( BusinessEntityID ) Fk FK_PersonPhone_PhoneNumberType_PhoneNumberTypeID PersonPhone ref PhoneNumberType ( PhoneNumberTypeID ) Fk FK_PersonPhone_PhoneNumberType_PhoneNumberTypeID PersonPhone ref PhoneNumberType ( PhoneNumberTypeID ) Fk FK_Product_ProductModel_ProductModelID Product ref ProductModel ( ProductModelID ) Fk FK_Product_ProductModel_ProductModelID Product ref ProductModel ( ProductModelID ) Fk FK_Product_ProductSubcategory_ProductSubcategoryID Product ref ProductSubcategory ( ProductSubcategoryID ) Fk FK_Product_ProductSubcategory_ProductSubcategoryID Product ref ProductSubcategory ( ProductSubcategoryID ) Fk FK_Product_UnitMeasure_SizeUnitMeasureCode Product ref UnitMeasure ( SizeUnitMeasureCode -> UnitMeasureCode ) Fk FK_Product_UnitMeasure_SizeUnitMeasureCode Product ref UnitMeasure ( SizeUnitMeasureCode -> UnitMeasureCode ) Fk FK_Product_UnitMeasure_WeightUnitMeasureCode Product ref UnitMeasure ( WeightUnitMeasureCode -> UnitMeasureCode ) Fk FK_Product_UnitMeasure_WeightUnitMeasureCode Product ref UnitMeasure ( WeightUnitMeasureCode -> UnitMeasureCode ) Fk FK_ProductCostHistory_Product_ProductID ProductCostHistory ref Product ( ProductID ) Fk FK_ProductCostHistory_Product_ProductID ProductCostHistory ref Product ( ProductID ) Fk FK_ProductDocument_Document_DocumentNode ProductDocument ref Document ( DocumentNode ) Fk FK_ProductDocument_Document_DocumentNode ProductDocument ref Document ( DocumentNode ) Fk FK_ProductDocument_Product_ProductID ProductDocument ref Product ( ProductID ) Fk FK_ProductDocument_Product_ProductID ProductDocument ref Product ( ProductID ) Fk FK_ProductInventory_Location_LocationID ProductInventory ref Location ( LocationID ) Fk FK_ProductInventory_Location_LocationID ProductInventory ref Location ( LocationID ) Fk FK_ProductInventory_Product_ProductID ProductInventory ref Product ( ProductID ) Fk FK_ProductInventory_Product_ProductID ProductInventory ref Product ( ProductID ) Fk FK_ProductListPriceHistory_Product_ProductID ProductListPriceHistory ref Product ( ProductID ) Fk FK_ProductListPriceHistory_Product_ProductID ProductListPriceHistory ref Product ( ProductID ) Fk FK_ProductModelIllustration_Illustration_IllustrationID ProductModelIllustration ref Illustration ( IllustrationID ) Fk FK_ProductModelIllustration_Illustration_IllustrationID ProductModelIllustration ref Illustration ( IllustrationID ) Fk FK_ProductModelIllustration_ProductModel_ProductModelID ProductModelIllustration ref ProductModel ( ProductModelID ) Fk FK_ProductModelIllustration_ProductModel_ProductModelID ProductModelIllustration ref ProductModel ( ProductModelID ) Fk FK_ProductModelProductDescriptionCulture_Culture_CultureID ProductModelProductDescriptionCulture ref Culture ( CultureID ) Fk FK_ProductModelProductDescriptionCulture_Culture_CultureID ProductModelProductDescriptionCulture ref Culture ( CultureID ) Fk FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID ProductModelProductDescriptionCulture ref ProductDescription ( ProductDescriptionID ) Fk FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID ProductModelProductDescriptionCulture ref ProductDescription ( ProductDescriptionID ) Fk FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID ProductModelProductDescriptionCulture ref ProductModel ( ProductModelID ) Fk FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID ProductModelProductDescriptionCulture ref ProductModel ( ProductModelID ) Fk FK_ProductProductPhoto_Product_ProductID ProductProductPhoto ref Product ( ProductID ) Fk FK_ProductProductPhoto_Product_ProductID ProductProductPhoto ref Product ( ProductID ) Fk FK_ProductProductPhoto_ProductPhoto_ProductPhotoID ProductProductPhoto ref ProductPhoto ( ProductPhotoID ) Fk FK_ProductProductPhoto_ProductPhoto_ProductPhotoID ProductProductPhoto ref ProductPhoto ( ProductPhotoID ) Fk FK_ProductReview_Product_ProductID ProductReview ref Product ( ProductID ) Fk FK_ProductReview_Product_ProductID ProductReview ref Product ( ProductID ) Fk FK_ProductSubcategory_ProductCategory_ProductCategoryID ProductSubcategory ref ProductCategory ( ProductCategoryID ) Fk FK_ProductSubcategory_ProductCategory_ProductCategoryID ProductSubcategory ref ProductCategory ( ProductCategoryID ) Fk FK_ProductVendor_Product_ProductID ProductVendor ref Product ( ProductID ) Fk FK_ProductVendor_Product_ProductID ProductVendor ref Product ( ProductID ) Fk FK_ProductVendor_UnitMeasure_UnitMeasureCode ProductVendor ref UnitMeasure ( UnitMeasureCode ) Fk FK_ProductVendor_UnitMeasure_UnitMeasureCode ProductVendor ref UnitMeasure ( UnitMeasureCode ) Fk FK_ProductVendor_Vendor_BusinessEntityID ProductVendor ref Vendor ( BusinessEntityID ) Fk FK_ProductVendor_Vendor_BusinessEntityID ProductVendor ref Vendor ( BusinessEntityID ) Fk FK_PurchaseOrderDetail_Product_ProductID PurchaseOrderDetail ref Product ( ProductID ) Fk FK_PurchaseOrderDetail_Product_ProductID PurchaseOrderDetail ref Product ( ProductID ) Fk FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID PurchaseOrderDetail ref PurchaseOrderHeader ( PurchaseOrderID ) Fk FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID PurchaseOrderDetail ref PurchaseOrderHeader ( PurchaseOrderID ) Fk FK_PurchaseOrderHeader_Employee_EmployeeID PurchaseOrderHeader ref Employee ( EmployeeID -> BusinessEntityID ) Fk FK_PurchaseOrderHeader_Employee_EmployeeID PurchaseOrderHeader ref Employee ( EmployeeID -> BusinessEntityID ) Fk FK_PurchaseOrderHeader_ShipMethod_ShipMethodID PurchaseOrderHeader ref ShipMethod ( ShipMethodID ) Fk FK_PurchaseOrderHeader_ShipMethod_ShipMethodID PurchaseOrderHeader ref ShipMethod ( ShipMethodID ) Fk FK_PurchaseOrderHeader_Vendor_VendorID PurchaseOrderHeader ref Vendor ( VendorID -> BusinessEntityID ) Fk FK_PurchaseOrderHeader_Vendor_VendorID PurchaseOrderHeader ref Vendor ( VendorID -> BusinessEntityID ) Fk FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID SalesOrderDetail ref SalesOrderHeader ( SalesOrderID ) Fk FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID SalesOrderDetail ref SalesOrderHeader ( SalesOrderID ) Cascade Fk FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID SalesOrderDetail ref SpecialOfferProduct ( SpecialOfferID, ProductID ) Fk FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID SalesOrderDetail ref SpecialOfferProduct ( SpecialOfferID, ProductID ) Fk FK_SalesOrderHeader_Address_BillToAddressID SalesOrderHeader ref Address ( BillToAddressID -> AddressID ) Fk FK_SalesOrderHeader_Address_BillToAddressID SalesOrderHeader ref Address ( BillToAddressID -> AddressID ) Fk FK_SalesOrderHeader_Address_ShipToAddressID SalesOrderHeader ref Address ( ShipToAddressID -> AddressID ) Fk FK_SalesOrderHeader_Address_ShipToAddressID SalesOrderHeader ref Address ( ShipToAddressID -> AddressID ) Fk FK_SalesOrderHeader_CreditCard_CreditCardID SalesOrderHeader ref CreditCard ( CreditCardID ) Fk FK_SalesOrderHeader_CreditCard_CreditCardID SalesOrderHeader ref CreditCard ( CreditCardID ) Fk FK_SalesOrderHeader_CurrencyRate_CurrencyRateID SalesOrderHeader ref CurrencyRate ( CurrencyRateID ) Fk FK_SalesOrderHeader_CurrencyRate_CurrencyRateID SalesOrderHeader ref CurrencyRate ( CurrencyRateID ) Fk FK_SalesOrderHeader_Customer_CustomerID SalesOrderHeader ref Customer ( CustomerID ) Fk FK_SalesOrderHeader_Customer_CustomerID SalesOrderHeader ref Customer ( CustomerID ) Fk FK_SalesOrderHeader_SalesPerson_SalesPersonID SalesOrderHeader ref SalesPerson ( SalesPersonID -> BusinessEntityID ) Fk FK_SalesOrderHeader_SalesPerson_SalesPersonID SalesOrderHeader ref SalesPerson ( SalesPersonID -> BusinessEntityID ) Fk FK_SalesOrderHeader_SalesTerritory_TerritoryID SalesOrderHeader ref SalesTerritory ( TerritoryID ) Fk FK_SalesOrderHeader_SalesTerritory_TerritoryID SalesOrderHeader ref SalesTerritory ( TerritoryID ) Fk FK_SalesOrderHeader_ShipMethod_ShipMethodID SalesOrderHeader ref ShipMethod ( ShipMethodID ) Fk FK_SalesOrderHeader_ShipMethod_ShipMethodID SalesOrderHeader ref ShipMethod ( ShipMethodID ) Fk FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID SalesOrderHeaderSalesReason ref SalesOrderHeader ( SalesOrderID ) Fk FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID SalesOrderHeaderSalesReason ref SalesOrderHeader ( SalesOrderID ) Cascade Fk FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID SalesOrderHeaderSalesReason ref SalesReason ( SalesReasonID ) Fk FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID SalesOrderHeaderSalesReason ref SalesReason ( SalesReasonID ) Fk FK_SalesPerson_SalesTerritory_TerritoryID SalesPerson ref SalesTerritory ( TerritoryID ) Fk FK_SalesPerson_SalesTerritory_TerritoryID SalesPerson ref SalesTerritory ( TerritoryID ) Fk FK_SalesPersonQuotaHistory_SalesPerson_BusinessEntityID SalesPersonQuotaHistory ref SalesPerson ( BusinessEntityID ) Fk FK_SalesPersonQuotaHistory_SalesPerson_BusinessEntityID SalesPersonQuotaHistory ref SalesPerson ( BusinessEntityID ) Fk FK_SalesTaxRate_StateProvince_StateProvinceID SalesTaxRate ref StateProvince ( StateProvinceID ) Fk FK_SalesTaxRate_StateProvince_StateProvinceID SalesTaxRate ref StateProvince ( StateProvinceID ) Fk FK_SalesTerritory_CountryRegion_CountryRegionCode SalesTerritory ref CountryRegion ( CountryRegionCode ) Fk FK_SalesTerritory_CountryRegion_CountryRegionCode SalesTerritory ref CountryRegion ( CountryRegionCode ) Fk FK_SalesTerritoryHistory_SalesPerson_BusinessEntityID SalesTerritoryHistory ref SalesPerson ( BusinessEntityID ) Fk FK_SalesTerritoryHistory_SalesPerson_BusinessEntityID SalesTerritoryHistory ref SalesPerson ( BusinessEntityID ) Fk FK_SalesTerritoryHistory_SalesTerritory_TerritoryID SalesTerritoryHistory ref SalesTerritory ( TerritoryID ) Fk FK_SalesTerritoryHistory_SalesTerritory_TerritoryID SalesTerritoryHistory ref SalesTerritory ( TerritoryID ) Fk FK_ShoppingCartItem_Product_ProductID ShoppingCartItem ref Product ( ProductID ) Fk FK_ShoppingCartItem_Product_ProductID ShoppingCartItem ref Product ( ProductID ) Fk FK_SpecialOfferProduct_Product_ProductID SpecialOfferProduct ref Product ( ProductID ) Fk FK_SpecialOfferProduct_Product_ProductID SpecialOfferProduct ref Product ( ProductID ) Fk FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID SpecialOfferProduct ref SpecialOffer ( SpecialOfferID ) Fk FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID SpecialOfferProduct ref SpecialOffer ( SpecialOfferID ) Fk FK_StateProvince_CountryRegion_CountryRegionCode StateProvince ref CountryRegion ( CountryRegionCode ) Fk FK_StateProvince_CountryRegion_CountryRegionCode StateProvince ref CountryRegion ( CountryRegionCode ) Fk FK_StateProvince_SalesTerritory_TerritoryID StateProvince ref SalesTerritory ( TerritoryID ) Fk FK_StateProvince_SalesTerritory_TerritoryID StateProvince ref SalesTerritory ( TerritoryID ) Fk FK_Store_BusinessEntity_BusinessEntityID Store ref BusinessEntity ( BusinessEntityID ) Fk FK_Store_BusinessEntity_BusinessEntityID Store ref BusinessEntity ( BusinessEntityID ) Fk FK_Store_SalesPerson_SalesPersonID Store ref SalesPerson ( SalesPersonID -> BusinessEntityID ) Fk FK_Store_SalesPerson_SalesPersonID Store ref SalesPerson ( SalesPersonID -> BusinessEntityID ) Fk FK_TransactionHistory_Product_ProductID TransactionHistory ref Product ( ProductID ) Fk FK_TransactionHistory_Product_ProductID TransactionHistory ref Product ( ProductID ) Fk FK_WorkOrder_Product_ProductID WorkOrder ref Product ( ProductID ) Fk FK_WorkOrder_Product_ProductID WorkOrder ref Product ( ProductID ) Fk FK_WorkOrder_ScrapReason_ScrapReasonID WorkOrder ref ScrapReason ( ScrapReasonID ) Fk FK_WorkOrder_ScrapReason_ScrapReasonID WorkOrder ref ScrapReason ( ScrapReasonID ) Fk FK_WorkOrderRouting_Location_LocationID WorkOrderRouting ref Location ( LocationID ) Fk FK_WorkOrderRouting_Location_LocationID WorkOrderRouting ref Location ( LocationID ) Fk FK_WorkOrderRouting_WorkOrder_WorkOrderID WorkOrderRouting ref WorkOrder ( WorkOrderID ) Fk FK_WorkOrderRouting_WorkOrder_WorkOrderID WorkOrderRouting ref WorkOrder ( WorkOrderID ) AWBuildVersionTable dbo.AWBuildVersion Current version number of the AdventureWorks 2016 sample database. Pk PK_AWBuildVersion_SystemInformationID ( SystemInformationID ) Clustered index created by a primary key constraint.SystemInformationIDSystemInformationID * tinyint Primary key for AWBuildVersion records. tinyint Database VersionDatabase Version * nvarchar(25) Version number of the database in 9.yy.mm.dd.00 format. nvarchar(25) VersionDateVersionDate * datetime Date and time the record was last updated. datetime ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime AddressTable Person.Address Street address information for customers, employees, and vendors. Pk PK_Address_AddressID ( AddressID ) Clustered index created by a primary key constraint.AddressIDAddressID * int Primary key for Address records. intReferred by BusinessEntityAddress ( AddressID ) Referred by SalesOrderHeader ( BillToAddressID -> AddressID ) Referred by SalesOrderHeader ( ShipToAddressID -> AddressID ) Unq IX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCode ( AddressLine1, AddressLine2, City, StateProvinceID, PostalCode ) Nonclustered index.AddressLine1AddressLine1 * nvarchar(60) First street address line. nvarchar(60) Unq IX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCode ( AddressLine1, AddressLine2, City, StateProvinceID, PostalCode ) Nonclustered index.AddressLine2AddressLine2 nvarchar(60) Second street address line. nvarchar(60) Unq IX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCode ( AddressLine1, AddressLine2, City, StateProvinceID, PostalCode ) Nonclustered index.CityCity * nvarchar(30) Name of the city. nvarchar(30) Unq IX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCode ( AddressLine1, AddressLine2, City, StateProvinceID, PostalCode ) Nonclustered index.IX_Address_StateProvinceID ( StateProvinceID ) Nonclustered index.StateProvinceIDStateProvinceID * int Unique identification number for the state or province. Foreign key to StateProvince table. intReferences StateProvince ( StateProvinceID ) Unq IX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCode ( AddressLine1, AddressLine2, City, StateProvinceID, PostalCode ) Nonclustered index.PostalCodePostalCode * nvarchar(15) Postal code for the street address. nvarchar(15) SpatialLocationSpatialLocation geography Latitude and longitude of this address. geography Unq AK_Address_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples.rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime AddressTypeTable Person.AddressType Types of addresses stored in the Address table. Pk PK_AddressType_AddressTypeID ( AddressTypeID ) Clustered index created by a primary key constraint.AddressTypeIDAddressTypeID * int Primary key for AddressType records. intReferred by BusinessEntityAddress ( AddressTypeID ) Unq AK_AddressType_Name ( Name ) Unique nonclustered index.NameName * name Address type description. For example, Billing, Home, or Shipping. name Unq AK_AddressType_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples.rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime BillOfMaterialsTable Production.BillOfMaterials Items required to make bicycles and bicycle subassemblies. It identifies the heirarchical relationship between a parent product and its components. Pk PK_BillOfMaterials_BillOfMaterialsID ( BillOfMaterialsID ) Nonclustered index created by a primary key constraint.BillOfMaterialsIDBillOfMaterialsID * int Primary key for BillOfMaterials records. int Unq AK_BillOfMaterials_ProductAssemblyID_ComponentID_StartDate ( ProductAssemblyID, ComponentID, StartDate ) Clustered index.ProductAssemblyIDProductAssemblyID int Parent product identification number. Foreign key to Product.ProductID. intReferences Product ( ProductAssemblyID -> ProductID ) Unq AK_BillOfMaterials_ProductAssemblyID_ComponentID_StartDate ( ProductAssemblyID, ComponentID, StartDate ) Clustered index.ComponentIDComponentID * int Component identification number. Foreign key to Product.ProductID. intReferences Product ( ComponentID -> ProductID ) Unq AK_BillOfMaterials_ProductAssemblyID_ComponentID_StartDate ( ProductAssemblyID, ComponentID, StartDate ) Clustered index.StartDateStartDate * datetime default getdate() Date the component started being used in the assembly item. datetime EndDateEndDate datetime Date the component stopped being used in the assembly item. datetime IX_BillOfMaterials_UnitMeasureCode ( UnitMeasureCode ) Nonclustered index.UnitMeasureCodeUnitMeasureCode * nchar(3) Standard code identifying the unit of measure for the quantity. nchar(3)References UnitMeasure ( UnitMeasureCode ) BOMLevelBOMLevel * smallint Indicates the depth the component is from its parent (AssemblyID). smallint PerAssemblyQtyPerAssemblyQty * decimal(8,2) default 1.00 Quantity of the component needed to create the assembly. decimal(8,2) ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime BusinessEntityTable Person.BusinessEntity Source of the ID that connects vendors, customers, and employees with address and contact information. Pk PK_BusinessEntity_BusinessEntityID ( BusinessEntityID ) Clustered index created by a primary key constraint.BusinessEntityIDBusinessEntityID * int Primary key for all customers, vendors, and employees. intReferred by BusinessEntityAddress ( BusinessEntityID ) Referred by BusinessEntityContact ( BusinessEntityID ) Referred by Person ( BusinessEntityID ) Referred by Vendor ( BusinessEntityID ) Referred by Store ( BusinessEntityID ) Unq AK_BusinessEntity_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples.rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime BusinessEntityAddressTable Person.BusinessEntityAddress Cross-reference table mapping customers, vendors, and employees to their addresses. Pk PK_BusinessEntityAddress_BusinessEntityID_AddressID_AddressTypeID ( BusinessEntityID, AddressID, AddressTypeID ) Clustered index created by a primary key constraint.BusinessEntityIDBusinessEntityID * int Primary key. Foreign key to BusinessEntity.BusinessEntityID. intReferences BusinessEntity ( BusinessEntityID ) Pk PK_BusinessEntityAddress_BusinessEntityID_AddressID_AddressTypeID ( BusinessEntityID, AddressID, AddressTypeID ) Clustered index created by a primary key constraint.IX_BusinessEntityAddress_AddressID ( AddressID ) Nonclustered index.AddressIDAddressID * int Primary key. Foreign key to Address.AddressID. intReferences Address ( AddressID ) Pk PK_BusinessEntityAddress_BusinessEntityID_AddressID_AddressTypeID ( BusinessEntityID, AddressID, AddressTypeID ) Clustered index created by a primary key constraint.IX_BusinessEntityAddress_AddressTypeID ( AddressTypeID ) Nonclustered index.AddressTypeIDAddressTypeID * int Primary key. Foreign key to AddressType.AddressTypeID. intReferences AddressType ( AddressTypeID ) Unq AK_BusinessEntityAddress_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples.rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime BusinessEntityContactTable Person.BusinessEntityContact Cross-reference table mapping stores, vendors, and employees to people Pk PK_BusinessEntityContact_BusinessEntityID_PersonID_ContactTypeID ( BusinessEntityID, PersonID, ContactTypeID ) Clustered index created by a primary key constraint.BusinessEntityIDBusinessEntityID * int Primary key. Foreign key to BusinessEntity.BusinessEntityID. intReferences BusinessEntity ( BusinessEntityID ) Pk PK_BusinessEntityContact_BusinessEntityID_PersonID_ContactTypeID ( BusinessEntityID, PersonID, ContactTypeID ) Clustered index created by a primary key constraint.IX_BusinessEntityContact_PersonID ( PersonID ) Nonclustered index.PersonIDPersonID * int Primary key. Foreign key to Person.BusinessEntityID. intReferences Person ( PersonID -> BusinessEntityID ) Pk PK_BusinessEntityContact_BusinessEntityID_PersonID_ContactTypeID ( BusinessEntityID, PersonID, ContactTypeID ) Clustered index created by a primary key constraint.IX_BusinessEntityContact_ContactTypeID ( ContactTypeID ) Nonclustered index.ContactTypeIDContactTypeID * int Primary key. Foreign key to ContactType.ContactTypeID. intReferences ContactType ( ContactTypeID ) Unq AK_BusinessEntityContact_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples.rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime ContactTypeTable Person.ContactType Lookup table containing the types of business entity contacts. Pk PK_ContactType_ContactTypeID ( ContactTypeID ) Clustered index created by a primary key constraint.ContactTypeIDContactTypeID * int Primary key for ContactType records. intReferred by BusinessEntityContact ( ContactTypeID ) Unq AK_ContactType_Name ( Name ) Unique nonclustered index.NameName * name Contact type description. name ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime CountryRegionTable Person.CountryRegion Lookup table containing the ISO standard codes for countries and regions. Pk PK_CountryRegion_CountryRegionCode ( CountryRegionCode ) Clustered index created by a primary key constraint.CountryRegionCodeCountryRegionCode * nvarchar(3) ISO standard code for countries and regions. nvarchar(3)Referred by StateProvince ( CountryRegionCode ) Referred by CountryRegionCurrency ( CountryRegionCode ) Referred by SalesTerritory ( CountryRegionCode ) Unq AK_CountryRegion_Name ( Name ) Unique nonclustered index.NameName * name Country or region name. name ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime CountryRegionCurrencyTable Sales.CountryRegionCurrency Cross-reference table mapping ISO currency codes to a country or region. Pk PK_CountryRegionCurrency_CountryRegionCode_CurrencyCode ( CountryRegionCode, CurrencyCode ) Clustered index created by a primary key constraint.CountryRegionCodeCountryRegionCode * nvarchar(3) ISO code for countries and regions. Foreign key to CountryRegion.CountryRegionCode. nvarchar(3)References CountryRegion ( CountryRegionCode ) Pk PK_CountryRegionCurrency_CountryRegionCode_CurrencyCode ( CountryRegionCode, CurrencyCode ) Clustered index created by a primary key constraint.IX_CountryRegionCurrency_CurrencyCode ( CurrencyCode ) Nonclustered index.CurrencyCodeCurrencyCode * nchar(3) ISO standard currency code. Foreign key to Currency.CurrencyCode. nchar(3)References Currency ( CurrencyCode ) ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime CreditCardTable Sales.CreditCard Customer credit card information. Pk PK_CreditCard_CreditCardID ( CreditCardID ) Clustered index created by a primary key constraint.CreditCardIDCreditCardID * int Primary key for CreditCard records. intReferred by PersonCreditCard ( CreditCardID ) Referred by SalesOrderHeader ( CreditCardID ) CardTypeCardType * nvarchar(50) Credit card name. nvarchar(50) Unq AK_CreditCard_CardNumber ( CardNumber ) Unique nonclustered index.CardNumberCardNumber * nvarchar(25) Credit card number. nvarchar(25) ExpMonthExpMonth * tinyint Credit card expiration month. tinyint ExpYearExpYear * smallint Credit card expiration year. smallint ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime CultureTable Production.Culture Lookup table containing the languages in which some AdventureWorks data is stored. Pk PK_Culture_CultureID ( CultureID ) Clustered index created by a primary key constraint.CultureIDCultureID * nchar(6) Primary key for Culture records. nchar(6)Referred by ProductModelProductDescriptionCulture ( CultureID ) Unq AK_Culture_Name ( Name ) Unique nonclustered index.NameName * name Culture description. name ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime CurrencyTable Sales.Currency Lookup table containing standard ISO currencies. Pk PK_Currency_CurrencyCode ( CurrencyCode ) Clustered index created by a primary key constraint.CurrencyCodeCurrencyCode * nchar(3) The ISO code for the Currency. nchar(3)Referred by CountryRegionCurrency ( CurrencyCode ) Referred by CurrencyRate ( FromCurrencyCode -> CurrencyCode ) Referred by CurrencyRate ( ToCurrencyCode -> CurrencyCode ) Unq AK_Currency_Name ( Name ) Unique nonclustered index.NameName * name Currency name. name ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime CurrencyRateTable Sales.CurrencyRate Currency exchange rates. Pk PK_CurrencyRate_CurrencyRateID ( CurrencyRateID ) Clustered index created by a primary key constraint.CurrencyRateIDCurrencyRateID * int Primary key for CurrencyRate records. intReferred by SalesOrderHeader ( CurrencyRateID ) Unq AK_CurrencyRate_CurrencyRateDate_FromCurrencyCode_ToCurrencyCode ( CurrencyRateDate, FromCurrencyCode, ToCurrencyCode ) Unique nonclustered index.CurrencyRateDateCurrencyRateDate * datetime Date and time the exchange rate was obtained. datetime Unq AK_CurrencyRate_CurrencyRateDate_FromCurrencyCode_ToCurrencyCode ( CurrencyRateDate, FromCurrencyCode, ToCurrencyCode ) Unique nonclustered index.FromCurrencyCodeFromCurrencyCode * nchar(3) Exchange rate was converted from this currency code. nchar(3)References Currency ( FromCurrencyCode -> CurrencyCode ) Unq AK_CurrencyRate_CurrencyRateDate_FromCurrencyCode_ToCurrencyCode ( CurrencyRateDate, FromCurrencyCode, ToCurrencyCode ) Unique nonclustered index.ToCurrencyCodeToCurrencyCode * nchar(3) Exchange rate was converted to this currency code. nchar(3)References Currency ( ToCurrencyCode -> CurrencyCode ) AverageRateAverageRate * money Average exchange rate for the day. money EndOfDayRateEndOfDayRate * money Final exchange rate for the day. money ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime CustomerTable Sales.Customer Current customer information. Also see the Person and Store tables. Pk PK_Customer_CustomerID ( CustomerID ) Clustered index created by a primary key constraint.CustomerIDCustomerID * int Primary key. intReferred by SalesOrderHeader ( CustomerID ) PersonIDPersonID int Foreign key to Person.BusinessEntityID intReferences Person ( PersonID -> BusinessEntityID ) StoreIDStoreID int Foreign key to Store.BusinessEntityID intReferences Store ( StoreID -> BusinessEntityID ) IX_Customer_TerritoryID ( TerritoryID ) Nonclustered index.TerritoryIDTerritoryID int ID of the territory in which the customer is located. Foreign key to SalesTerritory.SalesTerritoryID. intReferences SalesTerritory ( TerritoryID ) Unq AK_Customer_AccountNumber ( AccountNumber ) Unique nonclustered index.AccountNumberAccountNumber * varchar(10) Unique number identifying the customer assigned by the accounting system. varchar(10) Unq AK_Customer_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples.rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime DatabaseLogTable dbo.DatabaseLog Audit table tracking all DDL changes made to the AdventureWorks database. Data is captured by the database trigger ddlDatabaseTriggerLog. Pk PK_DatabaseLog_DatabaseLogID ( DatabaseLogID ) Nonclustered index created by a primary key constraint.DatabaseLogIDDatabaseLogID * int Primary key for DatabaseLog records. int PostTimePostTime * datetime The date and time the DDL change occurred. datetime DatabaseUserDatabaseUser * sysname The user who implemented the DDL change. sysname EventEvent * sysname The type of DDL statement that was executed. sysname SchemaSchema sysname The schema to which the changed object belongs. sysname ObjectObject sysname The object that was changed by the DDL statment. sysname TSQLTSQL * nvarchar(max) The exact Transact-SQL statement that was executed. nvarchar(max) XmlEventXmlEvent * xml The raw XML data generated by database trigger. xml DepartmentTable HumanResources.Department Lookup table containing the departments within the Adventure Works Cycles company. Pk PK_Department_DepartmentID ( DepartmentID ) Clustered index created by a primary key constraint.DepartmentIDDepartmentID * smallint Primary key for Department records. smallintReferred by EmployeeDepartmentHistory ( DepartmentID ) Unq AK_Department_Name ( Name ) Unique nonclustered index.NameName * name Name of the department. name GroupNameGroupName * name Name of the group to which the department belongs. name ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime DocumentTable Production.Document Product maintenance documents. Pk PK_Document_DocumentNode ( DocumentNode ) Clustered index created by a primary key constraint.Unq AK_Document_DocumentLevel_DocumentNode ( DocumentLevel, DocumentNode ) Unique nonclustered index.DocumentNodeDocumentNode * hierarchyid Primary key for Document records. hierarchyidReferred by ProductDocument ( DocumentNode ) Unq AK_Document_DocumentLevel_DocumentNode ( DocumentLevel, DocumentNode ) Unique nonclustered index.DocumentLevelDocumentLevel smallint Depth in the document hierarchy. smallint TitleTitle * nvarchar(50) Title of the document. nvarchar(50) OwnerOwner * int Employee who controls the document. Foreign key to Employee.BusinessEntityID intReferences Employee ( Owner -> BusinessEntityID ) FolderFlagFolderFlag * bit default 0 0 = This is a folder, 1 = This is a document. bit IX_Document_FileName_Revision ( FileName, Revision ) Unique nonclustered index.FileNameFileName * nvarchar(400) File name of the document nvarchar(400) FileExtensionFileExtension * nvarchar(8) File extension indicating the document type. For example, .doc or .txt. nvarchar(8) IX_Document_FileName_Revision ( FileName, Revision ) Unique nonclustered index.RevisionRevision * nchar(5) Revision number of the document. nchar(5) ChangeNumberChangeNumber * int default 0 Engineering change approval number. int StatusStatus * tinyint 1 = Pending approval, 2 = Approved, 3 = Obsolete tinyint DocumentSummaryDocumentSummary nvarchar(max) Document abstract. nvarchar(max) DocumentDocument varbinary(max) Complete document. varbinary(max) Unq UQ__Document__F73921F7C5112C2E ( rowguid ) rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Required for FileStream. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime EmailAddressTable Person.EmailAddress Where to send a person email. Pk PK_EmailAddress_BusinessEntityID_EmailAddressID ( BusinessEntityID, EmailAddressID ) Clustered index created by a primary key constraint.BusinessEntityIDBusinessEntityID * int Primary key. Person associated with this email address. Foreign key to Person.BusinessEntityID intReferences Person ( BusinessEntityID ) Pk PK_EmailAddress_BusinessEntityID_EmailAddressID ( BusinessEntityID, EmailAddressID ) Clustered index created by a primary key constraint.EmailAddressIDEmailAddressID * int Primary key. ID of this email address. int IX_EmailAddress_EmailAddress ( EmailAddress ) Nonclustered index.EmailAddressEmailAddress nvarchar(50) E-mail address for the person. nvarchar(50) rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime EmployeeTable HumanResources.Employee Employee information such as salary, department, and title. Pk PK_Employee_BusinessEntityID ( BusinessEntityID ) Clustered index created by a primary key constraint.BusinessEntityIDBusinessEntityID * int Primary key for Employee records. Foreign key to BusinessEntity.BusinessEntityID. intReferences Person ( BusinessEntityID ) Referred by EmployeeDepartmentHistory ( BusinessEntityID ) Referred by EmployeePayHistory ( BusinessEntityID ) Referred by JobCandidate ( BusinessEntityID ) Referred by Document ( Owner -> BusinessEntityID ) Referred by PurchaseOrderHeader ( EmployeeID -> BusinessEntityID ) Referred by SalesPerson ( BusinessEntityID ) Unq AK_Employee_NationalIDNumber ( NationalIDNumber ) Unique nonclustered index.NationalIDNumberNationalIDNumber * nvarchar(15) Unique national identification number such as a social security number. nvarchar(15) Unq AK_Employee_LoginID ( LoginID ) Unique nonclustered index.LoginIDLoginID * nvarchar(256) Network login. nvarchar(256) IX_Employee_OrganizationLevel_OrganizationNode ( OrganizationLevel, OrganizationNode ) Unique nonclustered index.IX_Employee_OrganizationNode ( OrganizationNode ) Unique nonclustered index.OrganizationNodeOrganizationNode hierarchyid Where the employee is located in corporate hierarchy. hierarchyid IX_Employee_OrganizationLevel_OrganizationNode ( OrganizationLevel, OrganizationNode ) Unique nonclustered index.OrganizationLevelOrganizationLevel smallint The depth of the employee in the corporate hierarchy. smallint JobTitleJobTitle * nvarchar(50) Work title such as Buyer or Sales Representative. nvarchar(50) BirthDateBirthDate * date Date of birth. date MaritalStatusMaritalStatus * nchar(1) M = Married, S = Single nchar(1) GenderGender * nchar(1) M = Male, F = Female nchar(1) HireDateHireDate * date Employee hired on this date. date SalariedFlagSalariedFlag * flag default 1 Job classification. 0 = Hourly, not exempt from collective bargaining. 1 = Salaried, exempt from collective bargaining. flag VacationHoursVacationHours * smallint default 0 Number of available vacation hours. smallint SickLeaveHoursSickLeaveHours * smallint default 0 Number of available sick leave hours. smallint CurrentFlagCurrentFlag * flag default 1 0 = Inactive, 1 = Active flag Unq AK_Employee_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples.rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime EmployeeDepartmentHistoryTable HumanResources.EmployeeDepartmentHistory Employee department transfers. Pk PK_EmployeeDepartmentHistory_BusinessEntityID_StartDate_DepartmentID ( BusinessEntityID, StartDate, DepartmentID, ShiftID ) Clustered index created by a primary key constraint.BusinessEntityIDBusinessEntityID * int Employee identification number. Foreign key to Employee.BusinessEntityID. intReferences Employee ( BusinessEntityID ) Pk PK_EmployeeDepartmentHistory_BusinessEntityID_StartDate_DepartmentID ( BusinessEntityID, StartDate, DepartmentID, ShiftID ) Clustered index created by a primary key constraint.StartDateStartDate * date Date the employee started work in the department. date Pk PK_EmployeeDepartmentHistory_BusinessEntityID_StartDate_DepartmentID ( BusinessEntityID, StartDate, DepartmentID, ShiftID ) Clustered index created by a primary key constraint.IX_EmployeeDepartmentHistory_DepartmentID ( DepartmentID ) Nonclustered index.DepartmentIDDepartmentID * smallint Department in which the employee worked including currently. Foreign key to Department.DepartmentID. smallintReferences Department ( DepartmentID ) Pk PK_EmployeeDepartmentHistory_BusinessEntityID_StartDate_DepartmentID ( BusinessEntityID, StartDate, DepartmentID, ShiftID ) Clustered index created by a primary key constraint.IX_EmployeeDepartmentHistory_ShiftID ( ShiftID ) Nonclustered index.ShiftIDShiftID * tinyint Identifies which 8-hour shift the employee works. Foreign key to Shift.Shift.ID. tinyintReferences Shift ( ShiftID ) EndDateEndDate date Date the employee left the department. NULL = Current department. date ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime EmployeePayHistoryTable HumanResources.EmployeePayHistory Employee pay history. Pk PK_EmployeePayHistory_BusinessEntityID_RateChangeDate ( BusinessEntityID, RateChangeDate ) Clustered index created by a primary key constraint.BusinessEntityIDBusinessEntityID * int Employee identification number. Foreign key to Employee.BusinessEntityID. intReferences Employee ( BusinessEntityID ) Pk PK_EmployeePayHistory_BusinessEntityID_RateChangeDate ( BusinessEntityID, RateChangeDate ) Clustered index created by a primary key constraint.RateChangeDateRateChangeDate * datetime Date the change in pay is effective datetime RateRate * money Salary hourly rate. money PayFrequencyPayFrequency * tinyint 1 = Salary received monthly, 2 = Salary received biweekly tinyint ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime ErrorLogTable dbo.ErrorLog Audit table tracking errors in the the AdventureWorks database that are caught by the CATCH block of a TRY...CATCH construct. Data is inserted by stored procedure dbo.uspLogError when it is executed from inside the CATCH block of a TRY...CATCH construct. Pk PK_ErrorLog_ErrorLogID ( ErrorLogID ) Clustered index created by a primary key constraint.ErrorLogIDErrorLogID * int Primary key for ErrorLog records. int ErrorTimeErrorTime * datetime default getdate() The date and time at which the error occurred. datetime UserNameUserName * sysname The user who executed the batch in which the error occurred. sysname ErrorNumberErrorNumber * int The error number of the error that occurred. int ErrorSeverityErrorSeverity int The severity of the error that occurred. int ErrorStateErrorState int The state number of the error that occurred. int ErrorProcedureErrorProcedure nvarchar(126) The name of the stored procedure or trigger where the error occurred. nvarchar(126) ErrorLineErrorLine int The line number at which the error occurred. int ErrorMessageErrorMessage * nvarchar(4000) The message text of the error that occurred. nvarchar(4000) IllustrationTable Production.Illustration Bicycle assembly diagrams. Pk PK_Illustration_IllustrationID ( IllustrationID ) Clustered index created by a primary key constraint.IllustrationIDIllustrationID * int Primary key for Illustration records. intReferred by ProductModelIllustration ( IllustrationID ) DiagramDiagram xml Illustrations used in manufacturing instructions. Stored as XML. xml ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime JobCandidateTable HumanResources.JobCandidate Résumés submitted to Human Resources by job applicants. Pk PK_JobCandidate_JobCandidateID ( JobCandidateID ) Clustered index created by a primary key constraint.JobCandidateIDJobCandidateID * int Primary key for JobCandidate records. int IX_JobCandidate_BusinessEntityID ( BusinessEntityID ) Nonclustered index.BusinessEntityIDBusinessEntityID int Employee identification number if applicant was hired. Foreign key to Employee.BusinessEntityID. intReferences Employee ( BusinessEntityID ) ResumeResume xml Résumé in XML format. xml ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime LocationTable Production.Location Product inventory and manufacturing locations. Pk PK_Location_LocationID ( LocationID ) Clustered index created by a primary key constraint.LocationIDLocationID * smallint Primary key for Location records. smallintReferred by ProductInventory ( LocationID ) Referred by WorkOrderRouting ( LocationID ) Unq AK_Location_Name ( Name ) Unique nonclustered index.NameName * name Location description. name CostRateCostRate * smallmoney default 0.00 Standard hourly cost of the manufacturing location. smallmoney AvailabilityAvailability * decimal(8,2) default 0.00 Work capacity (in hours) of the manufacturing location. decimal(8,2) ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime PasswordTable Person.Password One way hashed authentication information Pk PK_Password_BusinessEntityID ( BusinessEntityID ) Clustered index created by a primary key constraint.BusinessEntityIDBusinessEntityID * int intReferences Person ( BusinessEntityID ) PasswordHashPasswordHash * varchar(128) Password for the e-mail account. varchar(128) PasswordSaltPasswordSalt * varchar(10) Random value concatenated with the password string before the password is hashed. varchar(10) rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime PersonTable Person.Person Human beings involved with AdventureWorks: employees, customer contacts, and vendor contacts. Pk PK_Person_BusinessEntityID ( BusinessEntityID ) Clustered index created by a primary key constraint.BusinessEntityIDBusinessEntityID * int Primary key for Person records. intReferences BusinessEntity ( BusinessEntityID ) Referred by Employee ( BusinessEntityID ) Referred by BusinessEntityContact ( PersonID -> BusinessEntityID ) Referred by EmailAddress ( BusinessEntityID ) Referred by Password ( BusinessEntityID ) Referred by PersonPhone ( BusinessEntityID ) Referred by Customer ( PersonID -> BusinessEntityID ) Referred by PersonCreditCard ( BusinessEntityID ) PersonTypePersonType * nchar(2) Primary type of person: SC = Store Contact, IN = Individual (retail) customer, SP = Sales person, EM = Employee (non-sales), VC = Vendor contact, GC = General contact nchar(2) NameStyleNameStyle * namestyle default 0 0 = The data in FirstName and LastName are stored in western style (first name, last name) order. 1 = Eastern style (last name, first name) order. namestyle TitleTitle nvarchar(8) A courtesy title. For example, Mr. or Ms. nvarchar(8) IX_Person_LastName_FirstName_MiddleName ( LastName, FirstName, MiddleName ) FirstNameFirstName * name First name of the person. name IX_Person_LastName_FirstName_MiddleName ( LastName, FirstName, MiddleName ) MiddleNameMiddleName name Middle name or middle initial of the person. name IX_Person_LastName_FirstName_MiddleName ( LastName, FirstName, MiddleName ) LastNameLastName * name Last name of the person. name SuffixSuffix nvarchar(10) Surname suffix. For example, Sr. or Jr. nvarchar(10) EmailPromotionEmailPromotion * int default 0 0 = Contact does not wish to receive e-mail promotions, 1 = Contact does wish to receive e-mail promotions from AdventureWorks, 2 = Contact does wish to receive e-mail promotions from AdventureWorks and selected partners. int AdditionalContactInfoAdditionalContactInfo xml Additional contact information about the person stored in xml format. xml DemographicsDemographics xml Personal information such as hobbies, and income collected from online shoppers. Used for sales analysis. xml Unq AK_Person_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples.rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime PersonCreditCardTable Sales.PersonCreditCard Cross-reference table mapping people to their credit card information in the CreditCard table. Pk PK_PersonCreditCard_BusinessEntityID_CreditCardID ( BusinessEntityID, CreditCardID ) Clustered index created by a primary key constraint.BusinessEntityIDBusinessEntityID * int Business entity identification number. Foreign key to Person.BusinessEntityID. intReferences Person ( BusinessEntityID ) Pk PK_PersonCreditCard_BusinessEntityID_CreditCardID ( BusinessEntityID, CreditCardID ) Clustered index created by a primary key constraint.CreditCardIDCreditCardID * int Credit card identification number. Foreign key to CreditCard.CreditCardID. intReferences CreditCard ( CreditCardID ) ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime PersonPhoneTable Person.PersonPhone Telephone number and type of a person. Pk PK_PersonPhone_BusinessEntityID_PhoneNumber_PhoneNumberTypeID ( BusinessEntityID, PhoneNumber, PhoneNumberTypeID ) Clustered index created by a primary key constraint.BusinessEntityIDBusinessEntityID * int Business entity identification number. Foreign key to Person.BusinessEntityID. intReferences Person ( BusinessEntityID ) Pk PK_PersonPhone_BusinessEntityID_PhoneNumber_PhoneNumberTypeID ( BusinessEntityID, PhoneNumber, PhoneNumberTypeID ) Clustered index created by a primary key constraint.IX_PersonPhone_PhoneNumber ( PhoneNumber ) Nonclustered index.PhoneNumberPhoneNumber * phone Telephone number identification number. phone Pk PK_PersonPhone_BusinessEntityID_PhoneNumber_PhoneNumberTypeID ( BusinessEntityID, PhoneNumber, PhoneNumberTypeID ) Clustered index created by a primary key constraint.PhoneNumberTypeIDPhoneNumberTypeID * int Kind of phone number. Foreign key to PhoneNumberType.PhoneNumberTypeID. intReferences PhoneNumberType ( PhoneNumberTypeID ) ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime PhoneNumberTypeTable Person.PhoneNumberType Type of phone number of a person. Pk PK_PhoneNumberType_PhoneNumberTypeID ( PhoneNumberTypeID ) Clustered index created by a primary key constraint.PhoneNumberTypeIDPhoneNumberTypeID * int Primary key for telephone number type records. intReferred by PersonPhone ( PhoneNumberTypeID ) NameName * name Name of the telephone number type name ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime ProductTable Production.Product Products sold or used in the manfacturing of sold products. Pk PK_Product_ProductID ( ProductID ) Clustered index created by a primary key constraint.ProductIDProductID * int Primary key for Product records. intReferred by BillOfMaterials ( ComponentID -> ProductID ) Referred by BillOfMaterials ( ProductAssemblyID -> ProductID ) Referred by ProductCostHistory ( ProductID ) Referred by ProductDocument ( ProductID ) Referred by ProductInventory ( ProductID ) Referred by ProductListPriceHistory ( ProductID ) Referred by ProductProductPhoto ( ProductID ) Referred by ProductReview ( ProductID ) Referred by TransactionHistory ( ProductID ) Referred by WorkOrder ( ProductID ) Referred by ProductVendor ( ProductID ) Referred by PurchaseOrderDetail ( ProductID ) Referred by ShoppingCartItem ( ProductID ) Referred by SpecialOfferProduct ( ProductID ) Unq AK_Product_Name ( Name ) Unique nonclustered index.NameName * name Name of the product. name Unq AK_Product_ProductNumber ( ProductNumber ) Unique nonclustered index.ProductNumberProductNumber * nvarchar(25) Unique product identification number. nvarchar(25) MakeFlagMakeFlag * flag default 1 0 = Product is purchased, 1 = Product is manufactured in-house. flag FinishedGoodsFlagFinishedGoodsFlag * flag default 1 0 = Product is not a salable item. 1 = Product is salable. flag ColorColor nvarchar(15) Product color. nvarchar(15) SafetyStockLevelSafetyStockLevel * smallint Minimum inventory quantity. smallint ReorderPointReorderPoint * smallint Inventory level that triggers a purchase order or work order. smallint StandardCostStandardCost * money Standard cost of the product. money ListPriceListPrice * money Selling price. money SizeSize nvarchar(5) Product size. nvarchar(5) SizeUnitMeasureCodeSizeUnitMeasureCode nchar(3) Unit of measure for Size column. nchar(3)References UnitMeasure ( SizeUnitMeasureCode -> UnitMeasureCode ) WeightUnitMeasureCodeWeightUnitMeasureCode nchar(3) Unit of measure for Weight column. nchar(3)References UnitMeasure ( WeightUnitMeasureCode -> UnitMeasureCode ) WeightWeight decimal(8,2) Product weight. decimal(8,2) DaysToManufactureDaysToManufacture * int Number of days required to manufacture the product. int ProductLineProductLine nchar(2) R = Road, M = Mountain, T = Touring, S = Standard nchar(2) ClassClass nchar(2) H = High, M = Medium, L = Low nchar(2) StyleStyle nchar(2) W = Womens, M = Mens, U = Universal nchar(2) ProductSubcategoryIDProductSubcategoryID int Product is a member of this product subcategory. Foreign key to ProductSubCategory.ProductSubCategoryID. intReferences ProductSubcategory ( ProductSubcategoryID ) ProductModelIDProductModelID int Product is a member of this product model. Foreign key to ProductModel.ProductModelID. intReferences ProductModel ( ProductModelID ) SellStartDateSellStartDate * datetime Date the product was available for sale. datetime SellEndDateSellEndDate datetime Date the product was no longer available for sale. datetime DiscontinuedDateDiscontinuedDate datetime Date the product was discontinued. datetime Unq AK_Product_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples.rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime ProductCategoryTable Production.ProductCategory High-level product categorization. Pk PK_ProductCategory_ProductCategoryID ( ProductCategoryID ) Clustered index created by a primary key constraint.ProductCategoryIDProductCategoryID * int Primary key for ProductCategory records. intReferred by ProductSubcategory ( ProductCategoryID ) Unq AK_ProductCategory_Name ( Name ) Unique nonclustered index.NameName * name Category description. name Unq AK_ProductCategory_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples.rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime ProductCostHistoryTable Production.ProductCostHistory Changes in the cost of a product over time. Pk PK_ProductCostHistory_ProductID_StartDate ( ProductID, StartDate ) Clustered index created by a primary key constraint.ProductIDProductID * int Product identification number. Foreign key to Product.ProductID intReferences Product ( ProductID ) Pk PK_ProductCostHistory_ProductID_StartDate ( ProductID, StartDate ) Clustered index created by a primary key constraint.StartDateStartDate * datetime Product cost start date. datetime EndDateEndDate datetime Product cost end date. datetime StandardCostStandardCost * money Standard cost of the product. money ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime ProductDescriptionTable Production.ProductDescription Product descriptions in several languages. Pk PK_ProductDescription_ProductDescriptionID ( ProductDescriptionID ) Clustered index created by a primary key constraint.ProductDescriptionIDProductDescriptionID * int Primary key for ProductDescription records. intReferred by ProductModelProductDescriptionCulture ( ProductDescriptionID ) DescriptionDescription * nvarchar(400) Description of the product. nvarchar(400) Unq AK_ProductDescription_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples.rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime ProductDocumentTable Production.ProductDocument Cross-reference table mapping products to related product documents. Pk PK_ProductDocument_ProductID_DocumentNode ( ProductID, DocumentNode ) Clustered index created by a primary key constraint.ProductIDProductID * int Product identification number. Foreign key to Product.ProductID. intReferences Product ( ProductID ) Pk PK_ProductDocument_ProductID_DocumentNode ( ProductID, DocumentNode ) Clustered index created by a primary key constraint.DocumentNodeDocumentNode * hierarchyid Document identification number. Foreign key to Document.DocumentNode. hierarchyidReferences Document ( DocumentNode ) ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime ProductInventoryTable Production.ProductInventory Product inventory information. Pk PK_ProductInventory_ProductID_LocationID ( ProductID, LocationID ) Clustered index created by a primary key constraint.ProductIDProductID * int Product identification number. Foreign key to Product.ProductID. intReferences Product ( ProductID ) Pk PK_ProductInventory_ProductID_LocationID ( ProductID, LocationID ) Clustered index created by a primary key constraint.LocationIDLocationID * smallint Inventory location identification number. Foreign key to Location.LocationID. smallintReferences Location ( LocationID ) ShelfShelf * nvarchar(10) Storage compartment within an inventory location. nvarchar(10) BinBin * tinyint Storage container on a shelf in an inventory location. tinyint QuantityQuantity * smallint default 0 Quantity of products in the inventory location. smallint rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime ProductListPriceHistoryTable Production.ProductListPriceHistory Changes in the list price of a product over time. Pk PK_ProductListPriceHistory_ProductID_StartDate ( ProductID, StartDate ) Clustered index created by a primary key constraint.ProductIDProductID * int Product identification number. Foreign key to Product.ProductID intReferences Product ( ProductID ) Pk PK_ProductListPriceHistory_ProductID_StartDate ( ProductID, StartDate ) Clustered index created by a primary key constraint.StartDateStartDate * datetime List price start date. datetime EndDateEndDate datetime List price end date datetime ListPriceListPrice * money Product list price. money ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime ProductModelTable Production.ProductModel Product model classification. Pk PK_ProductModel_ProductModelID ( ProductModelID ) Clustered index created by a primary key constraint.ProductModelIDProductModelID * int Primary key for ProductModel records. intReferred by Product ( ProductModelID ) Referred by ProductModelIllustration ( ProductModelID ) Referred by ProductModelProductDescriptionCulture ( ProductModelID ) Unq AK_ProductModel_Name ( Name ) Unique nonclustered index.NameName * name Product model description. name CatalogDescriptionCatalogDescription xml Detailed product catalog information in xml format. xml InstructionsInstructions xml Manufacturing instructions in xml format. xml Unq AK_ProductModel_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples.rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime ProductModelIllustrationTable Production.ProductModelIllustration Cross-reference table mapping product models and illustrations. Pk PK_ProductModelIllustration_ProductModelID_IllustrationID ( ProductModelID, IllustrationID ) Clustered index created by a primary key constraint.ProductModelIDProductModelID * int Primary key. Foreign key to ProductModel.ProductModelID. intReferences ProductModel ( ProductModelID ) Pk PK_ProductModelIllustration_ProductModelID_IllustrationID ( ProductModelID, IllustrationID ) Clustered index created by a primary key constraint.IllustrationIDIllustrationID * int Primary key. Foreign key to Illustration.IllustrationID. intReferences Illustration ( IllustrationID ) ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime ProductModelProductDescriptionCultureTable Production.ProductModelProductDescriptionCulture Cross-reference table mapping product descriptions and the language the description is written in. Pk PK_ProductModelProductDescriptionCulture_ProductModelID_ProductDescriptionID_CultureID ( ProductModelID, ProductDescriptionID, CultureID ) Clustered index created by a primary key constraint.ProductModelIDProductModelID * int Primary key. Foreign key to ProductModel.ProductModelID. intReferences ProductModel ( ProductModelID ) Pk PK_ProductModelProductDescriptionCulture_ProductModelID_ProductDescriptionID_CultureID ( ProductModelID, ProductDescriptionID, CultureID ) Clustered index created by a primary key constraint.ProductDescriptionIDProductDescriptionID * int Primary key. Foreign key to ProductDescription.ProductDescriptionID. intReferences ProductDescription ( ProductDescriptionID ) Pk PK_ProductModelProductDescriptionCulture_ProductModelID_ProductDescriptionID_CultureID ( ProductModelID, ProductDescriptionID, CultureID ) Clustered index created by a primary key constraint.CultureIDCultureID * nchar(6) Culture identification number. Foreign key to Culture.CultureID. nchar(6)References Culture ( CultureID ) ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime ProductPhotoTable Production.ProductPhoto Product images. Pk PK_ProductPhoto_ProductPhotoID ( ProductPhotoID ) Clustered index created by a primary key constraint.ProductPhotoIDProductPhotoID * int Primary key for ProductPhoto records. intReferred by ProductProductPhoto ( ProductPhotoID ) ThumbNailPhotoThumbNailPhoto varbinary(max) Small image of the product. varbinary(max) ThumbnailPhotoFileNameThumbnailPhotoFileName nvarchar(50) Small image file name. nvarchar(50) LargePhotoLargePhoto varbinary(max) Large image of the product. varbinary(max) LargePhotoFileNameLargePhotoFileName nvarchar(50) Large image file name. nvarchar(50) ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime ProductProductPhotoTable Production.ProductProductPhoto Cross-reference table mapping products and product photos. Pk PK_ProductProductPhoto_ProductID_ProductPhotoID ( ProductID, ProductPhotoID ) Nonclustered index created by a primary key constraint.ProductIDProductID * int Product identification number. Foreign key to Product.ProductID. intReferences Product ( ProductID ) Pk PK_ProductProductPhoto_ProductID_ProductPhotoID ( ProductID, ProductPhotoID ) Nonclustered index created by a primary key constraint.ProductPhotoIDProductPhotoID * int Product photo identification number. Foreign key to ProductPhoto.ProductPhotoID. intReferences ProductPhoto ( ProductPhotoID ) PrimaryPrimary * flag default 0 0 = Photo is not the principal image. 1 = Photo is the principal image. flag ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime ProductReviewTable Production.ProductReview Customer reviews of products they have purchased. Pk PK_ProductReview_ProductReviewID ( ProductReviewID ) Clustered index created by a primary key constraint.ProductReviewIDProductReviewID * int Primary key for ProductReview records. int IX_ProductReview_ProductID_Name ( ProductID, ReviewerName ) Nonclustered index.ProductIDProductID * int Product identification number. Foreign key to Product.ProductID. intReferences Product ( ProductID ) IX_ProductReview_ProductID_Name ( ProductID, ReviewerName ) Nonclustered index.ReviewerNameReviewerName * name Name of the reviewer. name ReviewDateReviewDate * datetime default getdate() Date review was submitted. datetime EmailAddressEmailAddress * nvarchar(50) Reviewer's e-mail address. nvarchar(50) RatingRating * int Product rating given by the reviewer. Scale is 1 to 5 with 5 as the highest rating. int CommentsComments nvarchar(3850) Reviewer's comments nvarchar(3850) ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime ProductSubcategoryTable Production.ProductSubcategory Product subcategories. See ProductCategory table. Pk PK_ProductSubcategory_ProductSubcategoryID ( ProductSubcategoryID ) Clustered index created by a primary key constraint.ProductSubcategoryIDProductSubcategoryID * int Primary key for ProductSubcategory records. intReferred by Product ( ProductSubcategoryID ) ProductCategoryIDProductCategoryID * int Product category identification number. Foreign key to ProductCategory.ProductCategoryID. intReferences ProductCategory ( ProductCategoryID ) Unq AK_ProductSubcategory_Name ( Name ) Unique nonclustered index.NameName * name Subcategory description. name Unq AK_ProductSubcategory_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples.rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime ProductVendorTable Purchasing.ProductVendor Cross-reference table mapping vendors with the products they supply. Pk PK_ProductVendor_ProductID_BusinessEntityID ( ProductID, BusinessEntityID ) Clustered index created by a primary key constraint.ProductIDProductID * int Primary key. Foreign key to Product.ProductID. intReferences Product ( ProductID ) Pk PK_ProductVendor_ProductID_BusinessEntityID ( ProductID, BusinessEntityID ) Clustered index created by a primary key constraint.IX_ProductVendor_BusinessEntityID ( BusinessEntityID ) Nonclustered index.BusinessEntityIDBusinessEntityID * int Primary key. Foreign key to Vendor.BusinessEntityID. intReferences Vendor ( BusinessEntityID ) AverageLeadTimeAverageLeadTime * int The average span of time (in days) between placing an order with the vendor and receiving the purchased product. int StandardPriceStandardPrice * money The vendor's usual selling price. money LastReceiptCostLastReceiptCost money The selling price when last purchased. money LastReceiptDateLastReceiptDate datetime Date the product was last received by the vendor. datetime MinOrderQtyMinOrderQty * int The maximum quantity that should be ordered. int MaxOrderQtyMaxOrderQty * int The minimum quantity that should be ordered. int OnOrderQtyOnOrderQty int The quantity currently on order. int IX_ProductVendor_UnitMeasureCode ( UnitMeasureCode ) Nonclustered index.UnitMeasureCodeUnitMeasureCode * nchar(3) The product's unit of measure. nchar(3)References UnitMeasure ( UnitMeasureCode ) ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime PurchaseOrderDetailTable Purchasing.PurchaseOrderDetail Individual products associated with a specific purchase order. See PurchaseOrderHeader. Pk PK_PurchaseOrderDetail_PurchaseOrderID_PurchaseOrderDetailID ( PurchaseOrderID, PurchaseOrderDetailID ) Clustered index created by a primary key constraint.PurchaseOrderIDPurchaseOrderID * int Primary key. Foreign key to PurchaseOrderHeader.PurchaseOrderID. intReferences PurchaseOrderHeader ( PurchaseOrderID ) Pk PK_PurchaseOrderDetail_PurchaseOrderID_PurchaseOrderDetailID ( PurchaseOrderID, PurchaseOrderDetailID ) Clustered index created by a primary key constraint.PurchaseOrderDetailIDPurchaseOrderDetailID * int Primary key. One line number per purchased product. int DueDateDueDate * datetime Date the product is expected to be received. datetime OrderQtyOrderQty * smallint Quantity ordered. smallint IX_PurchaseOrderDetail_ProductID ( ProductID ) Nonclustered index.ProductIDProductID * int Product identification number. Foreign key to Product.ProductID. intReferences Product ( ProductID ) UnitPriceUnitPrice * money Vendor's selling price of a single product. money LineTotalLineTotal * money Per product subtotal. Computed as OrderQty * UnitPrice. money ReceivedQtyReceivedQty * decimal(8,2) Quantity actually received from the vendor. decimal(8,2) RejectedQtyRejectedQty * decimal(8,2) Quantity rejected during inspection. decimal(8,2) StockedQtyStockedQty * decimal(9,2) Quantity accepted into inventory. Computed as ReceivedQty - RejectedQty. decimal(9,2) ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime PurchaseOrderHeaderTable Purchasing.PurchaseOrderHeader General purchase order information. See PurchaseOrderDetail. Pk PK_PurchaseOrderHeader_PurchaseOrderID ( PurchaseOrderID ) Clustered index created by a primary key constraint.PurchaseOrderIDPurchaseOrderID * int Primary key. intReferred by PurchaseOrderDetail ( PurchaseOrderID ) RevisionNumberRevisionNumber * tinyint default 0 Incremental number to track changes to the purchase order over time. tinyint StatusStatus * tinyint default 1 Order current status. 1 = Pending; 2 = Approved; 3 = Rejected; 4 = Complete tinyint IX_PurchaseOrderHeader_EmployeeID ( EmployeeID ) Nonclustered index.EmployeeIDEmployeeID * int Employee who created the purchase order. Foreign key to Employee.BusinessEntityID. intReferences Employee ( EmployeeID -> BusinessEntityID ) IX_PurchaseOrderHeader_VendorID ( VendorID ) Nonclustered index.VendorIDVendorID * int Vendor with whom the purchase order is placed. Foreign key to Vendor.BusinessEntityID. intReferences Vendor ( VendorID -> BusinessEntityID ) ShipMethodIDShipMethodID * int Shipping method. Foreign key to ShipMethod.ShipMethodID. intReferences ShipMethod ( ShipMethodID ) OrderDateOrderDate * datetime default getdate() Purchase order creation date. datetime ShipDateShipDate datetime Estimated shipment date from the vendor. datetime SubTotalSubTotal * money default 0.00 Purchase order subtotal. Computed as SUM(PurchaseOrderDetail.LineTotal)for the appropriate PurchaseOrderID. money TaxAmtTaxAmt * money default 0.00 Tax amount. money FreightFreight * money default 0.00 Shipping cost. money TotalDueTotalDue * money Total due to vendor. Computed as Subtotal + TaxAmt + Freight. money ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime SalesOrderDetailTable Sales.SalesOrderDetail Individual products associated with a specific sales order. See SalesOrderHeader. Pk PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID ( SalesOrderID, SalesOrderDetailID ) Clustered index created by a primary key constraint.SalesOrderIDSalesOrderID * int Primary key. Foreign key to SalesOrderHeader.SalesOrderID. intReferences SalesOrderHeader ( SalesOrderID ) Pk PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID ( SalesOrderID, SalesOrderDetailID ) Clustered index created by a primary key constraint.SalesOrderDetailIDSalesOrderDetailID * int Primary key. One incremental unique number per product sold. int CarrierTrackingNumberCarrierTrackingNumber nvarchar(25) Shipment tracking number supplied by the shipper. nvarchar(25) OrderQtyOrderQty * smallint Quantity ordered per product. smallint IX_SalesOrderDetail_ProductID ( ProductID ) Nonclustered index.ProductIDProductID * int Product sold to customer. Foreign key to Product.ProductID. intReferences SpecialOfferProduct ( SpecialOfferID, ProductID ) SpecialOfferIDSpecialOfferID * int Promotional code. Foreign key to SpecialOffer.SpecialOfferID. intReferences SpecialOfferProduct ( SpecialOfferID, ProductID ) UnitPriceUnitPrice * money Selling price of a single product. money UnitPriceDiscountUnitPriceDiscount * money default 0.0 Discount amount. money LineTotalLineTotal * numeric(38,6) Per product subtotal. Computed as UnitPrice * (1 - UnitPriceDiscount) * OrderQty. numeric(38,6) Unq AK_SalesOrderDetail_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples.rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime SalesOrderHeaderTable Sales.SalesOrderHeader General sales order information. Pk PK_SalesOrderHeader_SalesOrderID ( SalesOrderID ) Clustered index created by a primary key constraint.SalesOrderIDSalesOrderID * int Primary key. intReferred by SalesOrderDetail ( SalesOrderID ) Referred by SalesOrderHeaderSalesReason ( SalesOrderID ) RevisionNumberRevisionNumber * tinyint default 0 Incremental number to track changes to the sales order over time. tinyint OrderDateOrderDate * datetime default getdate() Dates the sales order was created. datetime DueDateDueDate * datetime Date the order is due to the customer. datetime ShipDateShipDate datetime Date the order was shipped to the customer. datetime StatusStatus * tinyint default 1 Order current status. 1 = In process; 2 = Approved; 3 = Backordered; 4 = Rejected; 5 = Shipped; 6 = Cancelled tinyint OnlineOrderFlagOnlineOrderFlag * flag default 1 0 = Order placed by sales person. 1 = Order placed online by customer. flag Unq AK_SalesOrderHeader_SalesOrderNumber ( SalesOrderNumber ) Unique nonclustered index.SalesOrderNumberSalesOrderNumber * nvarchar(25) Unique sales order identification number. nvarchar(25) PurchaseOrderNumberPurchaseOrderNumber ordernumber Customer purchase order number reference. ordernumber AccountNumberAccountNumber accountnumber Financial accounting number reference. accountnumber IX_SalesOrderHeader_CustomerID ( CustomerID ) Nonclustered index.CustomerIDCustomerID * int Customer identification number. Foreign key to Customer.BusinessEntityID. intReferences Customer ( CustomerID ) IX_SalesOrderHeader_SalesPersonID ( SalesPersonID ) Nonclustered index.SalesPersonIDSalesPersonID int Sales person who created the sales order. Foreign key to SalesPerson.BusinessEntityID. intReferences SalesPerson ( SalesPersonID -> BusinessEntityID ) TerritoryIDTerritoryID int Territory in which the sale was made. Foreign key to SalesTerritory.SalesTerritoryID. intReferences SalesTerritory ( TerritoryID ) BillToAddressIDBillToAddressID * int Customer billing address. Foreign key to Address.AddressID. intReferences Address ( BillToAddressID -> AddressID ) ShipToAddressIDShipToAddressID * int Customer shipping address. Foreign key to Address.AddressID. intReferences Address ( ShipToAddressID -> AddressID ) ShipMethodIDShipMethodID * int Shipping method. Foreign key to ShipMethod.ShipMethodID. intReferences ShipMethod ( ShipMethodID ) CreditCardIDCreditCardID int Credit card identification number. Foreign key to CreditCard.CreditCardID. intReferences CreditCard ( CreditCardID ) CreditCardApprovalCodeCreditCardApprovalCode varchar(15) Approval code provided by the credit card company. varchar(15) CurrencyRateIDCurrencyRateID int Currency exchange rate used. Foreign key to CurrencyRate.CurrencyRateID. intReferences CurrencyRate ( CurrencyRateID ) SubTotalSubTotal * money default 0.00 Sales subtotal. Computed as SUM(SalesOrderDetail.LineTotal)for the appropriate SalesOrderID. money TaxAmtTaxAmt * money default 0.00 Tax amount. money FreightFreight * money default 0.00 Shipping cost. money TotalDueTotalDue * money Total due from customer. Computed as Subtotal + TaxAmt + Freight. money CommentComment nvarchar(128) Sales representative comments. nvarchar(128) Unq AK_SalesOrderHeader_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples.rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime SalesOrderHeaderSalesReasonTable Sales.SalesOrderHeaderSalesReason Cross-reference table mapping sales orders to sales reason codes. Pk PK_SalesOrderHeaderSalesReason_SalesOrderID_SalesReasonID ( SalesOrderID, SalesReasonID ) Clustered index created by a primary key constraint.SalesOrderIDSalesOrderID * int Primary key. Foreign key to SalesOrderHeader.SalesOrderID. intReferences SalesOrderHeader ( SalesOrderID ) Pk PK_SalesOrderHeaderSalesReason_SalesOrderID_SalesReasonID ( SalesOrderID, SalesReasonID ) Clustered index created by a primary key constraint.SalesReasonIDSalesReasonID * int Primary key. Foreign key to SalesReason.SalesReasonID. intReferences SalesReason ( SalesReasonID ) ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime SalesPersonTable Sales.SalesPerson Sales representative current information. Pk PK_SalesPerson_BusinessEntityID ( BusinessEntityID ) Clustered index created by a primary key constraint.BusinessEntityIDBusinessEntityID * int Primary key for SalesPerson records. Foreign key to Employee.BusinessEntityID intReferences Employee ( BusinessEntityID ) Referred by SalesOrderHeader ( SalesPersonID -> BusinessEntityID ) Referred by SalesPersonQuotaHistory ( BusinessEntityID ) Referred by SalesTerritoryHistory ( BusinessEntityID ) Referred by Store ( SalesPersonID -> BusinessEntityID ) TerritoryIDTerritoryID int Territory currently assigned to. Foreign key to SalesTerritory.SalesTerritoryID. intReferences SalesTerritory ( TerritoryID ) SalesQuotaSalesQuota money Projected yearly sales. money BonusBonus * money default 0.00 Bonus due if quota is met. money CommissionPctCommissionPct * smallmoney default 0.00 Commision percent received per sale. smallmoney SalesYTDSalesYTD * money default 0.00 Sales total year to date. money SalesLastYearSalesLastYear * money default 0.00 Sales total of previous year. money Unq AK_SalesPerson_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples.rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime SalesPersonQuotaHistoryTable Sales.SalesPersonQuotaHistory Sales performance tracking. Pk PK_SalesPersonQuotaHistory_BusinessEntityID_QuotaDate ( BusinessEntityID, QuotaDate ) Clustered index created by a primary key constraint.BusinessEntityIDBusinessEntityID * int Sales person identification number. Foreign key to SalesPerson.BusinessEntityID. intReferences SalesPerson ( BusinessEntityID ) Pk PK_SalesPersonQuotaHistory_BusinessEntityID_QuotaDate ( BusinessEntityID, QuotaDate ) Clustered index created by a primary key constraint.QuotaDateQuotaDate * datetime Sales quota date. datetime SalesQuotaSalesQuota * money Sales quota amount. money Unq AK_SalesPersonQuotaHistory_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples.rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime SalesReasonTable Sales.SalesReason Lookup table of customer purchase reasons. Pk PK_SalesReason_SalesReasonID ( SalesReasonID ) Clustered index created by a primary key constraint.SalesReasonIDSalesReasonID * int Primary key for SalesReason records. intReferred by SalesOrderHeaderSalesReason ( SalesReasonID ) NameName * name Sales reason description. name ReasonTypeReasonType * name Category the sales reason belongs to. name ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime SalesTaxRateTable Sales.SalesTaxRate Tax rate lookup table. Pk PK_SalesTaxRate_SalesTaxRateID ( SalesTaxRateID ) Clustered index created by a primary key constraint.SalesTaxRateIDSalesTaxRateID * int Primary key for SalesTaxRate records. int Unq AK_SalesTaxRate_StateProvinceID_TaxType ( StateProvinceID, TaxType ) Unique nonclustered index.StateProvinceIDStateProvinceID * int State, province, or country/region the sales tax applies to. intReferences StateProvince ( StateProvinceID ) Unq AK_SalesTaxRate_StateProvinceID_TaxType ( StateProvinceID, TaxType ) Unique nonclustered index.TaxTypeTaxType * tinyint 1 = Tax applied to retail transactions, 2 = Tax applied to wholesale transactions, 3 = Tax applied to all sales (retail and wholesale) transactions. tinyint TaxRateTaxRate * smallmoney default 0.00 Tax rate amount. smallmoney NameName * name Tax rate description. name Unq AK_SalesTaxRate_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples.rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime SalesTerritoryTable Sales.SalesTerritory Sales territory lookup table. Unq AK_SalesTerritory_Name ( Name ) Unique nonclustered index.NameName * name Sales territory description name CountryRegionCodeCountryRegionCode * nvarchar(3) ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode. nvarchar(3)References CountryRegion ( CountryRegionCode ) GroupGroup * nvarchar(50) Geographic area to which the sales territory belong. nvarchar(50) Pk PK_SalesTerritory_TerritoryID ( TerritoryID ) Clustered index created by a primary key constraint.TerritoryIDTerritoryID * int Primary key for SalesTerritory records. intReferred by StateProvince ( TerritoryID ) Referred by Customer ( TerritoryID ) Referred by SalesOrderHeader ( TerritoryID ) Referred by SalesPerson ( TerritoryID ) Referred by SalesTerritoryHistory ( TerritoryID ) SalesYTDSalesYTD * money default 0.00 Sales in the territory year to date. money SalesLastYearSalesLastYear * money default 0.00 Sales in the territory the previous year. money CostYTDCostYTD * money default 0.00 Business costs in the territory year to date. money CostLastYearCostLastYear * money default 0.00 Business costs in the territory the previous year. money Unq AK_SalesTerritory_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples.rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime SalesTerritoryHistoryTable Sales.SalesTerritoryHistory Sales representative transfers to other sales territories. Pk PK_SalesTerritoryHistory_BusinessEntityID_StartDate_TerritoryID ( BusinessEntityID, StartDate, TerritoryID ) Clustered index created by a primary key constraint.BusinessEntityIDBusinessEntityID * int Primary key. The sales rep. Foreign key to SalesPerson.BusinessEntityID. intReferences SalesPerson ( BusinessEntityID ) Pk PK_SalesTerritoryHistory_BusinessEntityID_StartDate_TerritoryID ( BusinessEntityID, StartDate, TerritoryID ) Clustered index created by a primary key constraint.StartDateStartDate * datetime Primary key. Date the sales representive started work in the territory. datetime Pk PK_SalesTerritoryHistory_BusinessEntityID_StartDate_TerritoryID ( BusinessEntityID, StartDate, TerritoryID ) Clustered index created by a primary key constraint.TerritoryIDTerritoryID * int Primary key. Territory identification number. Foreign key to SalesTerritory.SalesTerritoryID. intReferences SalesTerritory ( TerritoryID ) EndDateEndDate datetime Date the sales representative left work in the territory. datetime Unq AK_SalesTerritoryHistory_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples.rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime ScrapReasonTable Production.ScrapReason Manufacturing failure reasons lookup table. Pk PK_ScrapReason_ScrapReasonID ( ScrapReasonID ) Clustered index created by a primary key constraint.ScrapReasonIDScrapReasonID * smallint Primary key for ScrapReason records. smallintReferred by WorkOrder ( ScrapReasonID ) Unq AK_ScrapReason_Name ( Name ) Unique nonclustered index.NameName * name Failure description. name ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime ShiftTable HumanResources.Shift Work shift lookup table. Pk PK_Shift_ShiftID ( ShiftID ) Clustered index created by a primary key constraint.ShiftIDShiftID * tinyint Primary key for Shift records. tinyintReferred by EmployeeDepartmentHistory ( ShiftID ) Unq AK_Shift_Name ( Name ) Unique nonclustered index.NameName * name Shift description. name Unq AK_Shift_StartTime_EndTime ( StartTime, EndTime ) Unique nonclustered index.StartTimeStartTime * time(16) Shift start time. time(16) Unq AK_Shift_StartTime_EndTime ( StartTime, EndTime ) Unique nonclustered index.EndTimeEndTime * time(16) Shift end time. time(16) ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime ShipMethodTable Purchasing.ShipMethod Shipping company lookup table. Pk PK_ShipMethod_ShipMethodID ( ShipMethodID ) Clustered index created by a primary key constraint.ShipMethodIDShipMethodID * int Primary key for ShipMethod records. intReferred by PurchaseOrderHeader ( ShipMethodID ) Referred by SalesOrderHeader ( ShipMethodID ) Unq AK_ShipMethod_Name ( Name ) Unique nonclustered index.NameName * name Shipping company name. name ShipBaseShipBase * money default 0.00 Minimum shipping charge. money ShipRateShipRate * money default 0.00 Shipping charge per pound. money Unq AK_ShipMethod_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples.rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime ShoppingCartItemTable Sales.ShoppingCartItem Contains online customer orders until the order is submitted or cancelled. Pk PK_ShoppingCartItem_ShoppingCartItemID ( ShoppingCartItemID ) Clustered index created by a primary key constraint.ShoppingCartItemIDShoppingCartItemID * int Primary key for ShoppingCartItem records. int IX_ShoppingCartItem_ShoppingCartID_ProductID ( ShoppingCartID, ProductID ) Nonclustered index.ShoppingCartIDShoppingCartID * nvarchar(50) Shopping cart identification number. nvarchar(50) QuantityQuantity * int default 1 Product quantity ordered. int IX_ShoppingCartItem_ShoppingCartID_ProductID ( ShoppingCartID, ProductID ) Nonclustered index.ProductIDProductID * int Product ordered. Foreign key to Product.ProductID. intReferences Product ( ProductID ) DateCreatedDateCreated * datetime default getdate() Date the time the record was created. datetime ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime SpecialOfferTable Sales.SpecialOffer Sale discounts lookup table. Pk PK_SpecialOffer_SpecialOfferID ( SpecialOfferID ) Clustered index created by a primary key constraint.SpecialOfferIDSpecialOfferID * int Primary key for SpecialOffer records. intReferred by SpecialOfferProduct ( SpecialOfferID ) DescriptionDescription * nvarchar(255) Discount description. nvarchar(255) DiscountPctDiscountPct * smallmoney default 0.00 Discount precentage. smallmoney TypeType * nvarchar(50) Discount type category. nvarchar(50) CategoryCategory * nvarchar(50) Group the discount applies to such as Reseller or Customer. nvarchar(50) StartDateStartDate * datetime Discount start date. datetime EndDateEndDate * datetime Discount end date. datetime MinQtyMinQty * int default 0 Minimum discount percent allowed. int MaxQtyMaxQty int Maximum discount percent allowed. int Unq AK_SpecialOffer_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples.rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime SpecialOfferProductTable Sales.SpecialOfferProduct Cross-reference table mapping products to special offer discounts. Pk PK_SpecialOfferProduct_SpecialOfferID_ProductID ( SpecialOfferID, ProductID ) Clustered index created by a primary key constraint.SpecialOfferIDSpecialOfferID * int Primary key for SpecialOfferProduct records. intReferences SpecialOffer ( SpecialOfferID ) Referred by SalesOrderDetail ( SpecialOfferID, ProductID ) Pk PK_SpecialOfferProduct_SpecialOfferID_ProductID ( SpecialOfferID, ProductID ) Clustered index created by a primary key constraint.IX_SpecialOfferProduct_ProductID ( ProductID ) Nonclustered index.ProductIDProductID * int Product identification number. Foreign key to Product.ProductID. intReferences Product ( ProductID ) Referred by SalesOrderDetail ( SpecialOfferID, ProductID ) Unq AK_SpecialOfferProduct_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples.rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime StateProvinceTable Person.StateProvince State and province lookup table. Pk PK_StateProvince_StateProvinceID ( StateProvinceID ) Clustered index created by a primary key constraint.StateProvinceIDStateProvinceID * int Primary key for StateProvince records. intReferred by Address ( StateProvinceID ) Referred by SalesTaxRate ( StateProvinceID ) Unq AK_StateProvince_StateProvinceCode_CountryRegionCode ( StateProvinceCode, CountryRegionCode ) Unique nonclustered index.StateProvinceCodeStateProvinceCode * nchar(3) ISO standard state or province code. nchar(3) Unq AK_StateProvince_StateProvinceCode_CountryRegionCode ( StateProvinceCode, CountryRegionCode ) Unique nonclustered index.CountryRegionCodeCountryRegionCode * nvarchar(3) ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode. nvarchar(3)References CountryRegion ( CountryRegionCode ) IsOnlyStateProvinceFlagIsOnlyStateProvinceFlag * flag default 1 0 = StateProvinceCode exists. 1 = StateProvinceCode unavailable, using CountryRegionCode. flag Unq AK_StateProvince_Name ( Name ) Unique nonclustered index.NameName * name State or province description. name TerritoryIDTerritoryID * int ID of the territory in which the state or province is located. Foreign key to SalesTerritory.SalesTerritoryID. intReferences SalesTerritory ( TerritoryID ) Unq AK_StateProvince_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples.rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime StoreTable Sales.Store Customers (resellers) of Adventure Works products. Pk PK_Store_BusinessEntityID ( BusinessEntityID ) Clustered index created by a primary key constraint.BusinessEntityIDBusinessEntityID * int Primary key. Foreign key to Customer.BusinessEntityID. intReferences BusinessEntity ( BusinessEntityID ) Referred by Customer ( StoreID -> BusinessEntityID ) NameName * name Name of the store. name IX_Store_SalesPersonID ( SalesPersonID ) Nonclustered index.SalesPersonIDSalesPersonID int ID of the sales person assigned to the customer. Foreign key to SalesPerson.BusinessEntityID. intReferences SalesPerson ( SalesPersonID -> BusinessEntityID ) DemographicsDemographics xml Demographic informationg about the store such as the number of employees, annual sales and store type. xml Unq AK_Store_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples.rowguidrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. uniqueidentifier ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime TransactionHistoryTable Production.TransactionHistory Record of each purchase order, sales order, or work order transaction year to date. Pk PK_TransactionHistory_TransactionID ( TransactionID ) Clustered index created by a primary key constraint.TransactionIDTransactionID * int Primary key for TransactionHistory records. int IX_TransactionHistory_ProductID ( ProductID ) Nonclustered index.ProductIDProductID * int Product identification number. Foreign key to Product.ProductID. intReferences Product ( ProductID ) IX_TransactionHistory_ReferenceOrderID_ReferenceOrderLineID ( ReferenceOrderID, ReferenceOrderLineID ) Nonclustered index.ReferenceOrderIDReferenceOrderID * int Purchase order, sales order, or work order identification number. int IX_TransactionHistory_ReferenceOrderID_ReferenceOrderLineID ( ReferenceOrderID, ReferenceOrderLineID ) Nonclustered index.ReferenceOrderLineIDReferenceOrderLineID * int default 0 Line number associated with the purchase order, sales order, or work order. int TransactionDateTransactionDate * datetime default getdate() Date and time of the transaction. datetime TransactionTypeTransactionType * nchar(1) W = WorkOrder, S = SalesOrder, P = PurchaseOrder nchar(1) QuantityQuantity * int Product quantity. int ActualCostActualCost * money Product cost. money ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime TransactionHistoryArchiveTable Production.TransactionHistoryArchive Transactions for previous years. Pk PK_TransactionHistoryArchive_TransactionID ( TransactionID ) Clustered index created by a primary key constraint.TransactionIDTransactionID * int Primary key for TransactionHistoryArchive records. int IX_TransactionHistoryArchive_ProductID ( ProductID ) Nonclustered index.ProductIDProductID * int Product identification number. Foreign key to Product.ProductID. int IX_TransactionHistoryArchive_ReferenceOrderID_ReferenceOrderLineID ( ReferenceOrderID, ReferenceOrderLineID ) Nonclustered index.ReferenceOrderIDReferenceOrderID * int Purchase order, sales order, or work order identification number. int IX_TransactionHistoryArchive_ReferenceOrderID_ReferenceOrderLineID ( ReferenceOrderID, ReferenceOrderLineID ) Nonclustered index.ReferenceOrderLineIDReferenceOrderLineID * int default 0 Line number associated with the purchase order, sales order, or work order. int TransactionDateTransactionDate * datetime default getdate() Date and time of the transaction. datetime TransactionTypeTransactionType * nchar(1) W = Work Order, S = Sales Order, P = Purchase Order nchar(1) QuantityQuantity * int Product quantity. int ActualCostActualCost * money Product cost. money ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime UnitMeasureTable Production.UnitMeasure Unit of measure lookup table. Pk PK_UnitMeasure_UnitMeasureCode ( UnitMeasureCode ) Clustered index created by a primary key constraint.UnitMeasureCodeUnitMeasureCode * nchar(3) Primary key. nchar(3)Referred by BillOfMaterials ( UnitMeasureCode ) Referred by Product ( SizeUnitMeasureCode -> UnitMeasureCode ) Referred by Product ( WeightUnitMeasureCode -> UnitMeasureCode ) Referred by ProductVendor ( UnitMeasureCode ) Unq AK_UnitMeasure_Name ( Name ) Unique nonclustered index.NameName * name Unit of measure description. name ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime VendorTable Purchasing.Vendor Companies from whom Adventure Works Cycles purchases parts or other goods. Pk PK_Vendor_BusinessEntityID ( BusinessEntityID ) Clustered index created by a primary key constraint.BusinessEntityIDBusinessEntityID * int Primary key for Vendor records. Foreign key to BusinessEntity.BusinessEntityID intReferences BusinessEntity ( BusinessEntityID ) Referred by ProductVendor ( BusinessEntityID ) Referred by PurchaseOrderHeader ( VendorID -> BusinessEntityID ) Unq AK_Vendor_AccountNumber ( AccountNumber ) Unique nonclustered index.AccountNumberAccountNumber * accountnumber Vendor account (identification) number. accountnumber NameName * name Company name. name CreditRatingCreditRating * tinyint 1 = Superior, 2 = Excellent, 3 = Above average, 4 = Average, 5 = Below average tinyint PreferredVendorStatusPreferredVendorStatus * flag default 1 0 = Do not use if another vendor is available. 1 = Preferred over other vendors supplying the same product. flag ActiveFlagActiveFlag * flag default 1 0 = Vendor no longer used. 1 = Vendor is actively used. flag PurchasingWebServiceURLPurchasingWebServiceURL nvarchar(1024) Vendor URL. nvarchar(1024) ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime WorkOrderTable Production.WorkOrder Manufacturing work orders. Pk PK_WorkOrder_WorkOrderID ( WorkOrderID ) Clustered index created by a primary key constraint.WorkOrderIDWorkOrderID * int Primary key for WorkOrder records. intReferred by WorkOrderRouting ( WorkOrderID ) IX_WorkOrder_ProductID ( ProductID ) Nonclustered index.ProductIDProductID * int Product identification number. Foreign key to Product.ProductID. intReferences Product ( ProductID ) OrderQtyOrderQty * int Product quantity to build. int StockedQtyStockedQty * int Quantity built and put in inventory. int ScrappedQtyScrappedQty * smallint Quantity that failed inspection. smallint StartDateStartDate * datetime Work order start date. datetime EndDateEndDate datetime Work order end date. datetime DueDateDueDate * datetime Work order due date. datetime IX_WorkOrder_ScrapReasonID ( ScrapReasonID ) Nonclustered index.ScrapReasonIDScrapReasonID smallint Reason for inspection failure. smallintReferences ScrapReason ( ScrapReasonID ) ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime WorkOrderRoutingTable Production.WorkOrderRouting Work order details. Pk PK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequence ( WorkOrderID, ProductID, OperationSequence ) Clustered index created by a primary key constraint.WorkOrderIDWorkOrderID * int Primary key. Foreign key to WorkOrder.WorkOrderID. intReferences WorkOrder ( WorkOrderID ) Pk PK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequence ( WorkOrderID, ProductID, OperationSequence ) Clustered index created by a primary key constraint.IX_WorkOrderRouting_ProductID ( ProductID ) Nonclustered index.ProductIDProductID * int Primary key. Foreign key to Product.ProductID. int Pk PK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequence ( WorkOrderID, ProductID, OperationSequence ) Clustered index created by a primary key constraint.OperationSequenceOperationSequence * smallint Primary key. Indicates the manufacturing process sequence. smallint LocationIDLocationID * smallint Manufacturing location where the part is processed. Foreign key to Location.LocationID. smallintReferences Location ( LocationID ) ScheduledStartDateScheduledStartDate * datetime Planned manufacturing start date. datetime ScheduledEndDateScheduledEndDate * datetime Planned manufacturing end date. datetime ActualStartDateActualStartDate datetime Actual start date. datetime ActualEndDateActualEndDate datetime Actual end date. datetime ActualResourceHrsActualResourceHrs decimal(9,4) Number of manufacturing hours used. decimal(9,4) PlannedCostPlannedCost * money Estimated manufacturing cost. money ActualCostActualCost money Actual manufacturing cost. money ModifiedDateModifiedDate * datetime default getdate() Date and time the record was last updated. datetime
Tables



Table AWBuildVersion

Current version number of the AdventureWorks 2016 sample database.

IdxField NameData TypeDescription
* SystemInformationID tinyint AUTOINCREMENT Primary key for AWBuildVersion records.
* Database Version nvarchar(25) Version number of the database in 9.yy.mm.dd.00 format.
* VersionDate datetime Date and time the record was last updated.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_AWBuildVersion_SystemInformationID ON SystemInformationID Clustered index created by a primary key constraint.


Table Address

Street address information for customers, employees, and vendors.

IdxField NameData TypeDescription
* AddressID int AUTOINCREMENT Primary key for Address records.
* AddressLine1 nvarchar(60) First street address line.
AddressLine2 nvarchar(60) Second street address line.
* City nvarchar(30) Name of the city.
* StateProvinceID int Unique identification number for the state or province. Foreign key to StateProvince table.
* PostalCode nvarchar(15) Postal code for the street address.
  SpatialLocation geography Latitude and longitude of this address.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_Address_AddressID ON AddressID Clustered index created by a primary key constraint.
AK_Address_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.
IX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCode ON AddressLine1, AddressLine2, City, StateProvinceID, PostalCode Nonclustered index.
IX_Address_StateProvinceID ON StateProvinceID Nonclustered index.
Foreign Keys
FK_Address_StateProvince_StateProvinceID ( StateProvinceID ) ref StateProvince (StateProvinceID) Foreign key constraint referencing StateProvince.StateProvinceID.


Table AddressType

Types of addresses stored in the Address table.

IdxField NameData TypeDescription
* AddressTypeID int AUTOINCREMENT Primary key for AddressType records.
* Name name Address type description. For example, Billing, Home, or Shipping.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_AddressType_AddressTypeID ON AddressTypeID Clustered index created by a primary key constraint.
AK_AddressType_Name ON Name Unique nonclustered index.
AK_AddressType_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.


Table BillOfMaterials

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

IdxField NameData TypeDescription
* BillOfMaterialsID int AUTOINCREMENT Primary key for BillOfMaterials records.
ProductAssemblyID int Parent product identification number. Foreign key to Product.ProductID.
* ComponentID int Component identification number. Foreign key to Product.ProductID.
* StartDate datetime DEFAULT getdate() Date the component started being used in the assembly item.
  EndDate datetime Date the component stopped being used in the assembly item.
* UnitMeasureCode nchar(3) Standard code identifying the unit of measure for the quantity.
* BOMLevel smallint Indicates the depth the component is from its parent (AssemblyID).
* PerAssemblyQty decimal(8,2) DEFAULT 1.00 Quantity of the component needed to create the assembly.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_BillOfMaterials_BillOfMaterialsID ON BillOfMaterialsID Nonclustered index created by a primary key constraint.
AK_BillOfMaterials_ProductAssemblyID_ComponentID_StartDate ON ProductAssemblyID, ComponentID, StartDate Clustered index.
IX_BillOfMaterials_UnitMeasureCode ON UnitMeasureCode Nonclustered index.
Foreign Keys
FK_BillOfMaterials_Product_ComponentID ( ComponentID ) ref Product (ProductID) Foreign key constraint referencing Product.ComponentID.
FK_BillOfMaterials_Product_ProductAssemblyID ( ProductAssemblyID ) ref Product (ProductID) Foreign key constraint referencing Product.ProductAssemblyID.
FK_BillOfMaterials_UnitMeasure_UnitMeasureCode ( UnitMeasureCode ) ref UnitMeasure (UnitMeasureCode) Foreign key constraint referencing UnitMeasure.UnitMeasureCode.
Constraints
  CK_BillOfMaterials_ProductAssemblyID [ProductAssemblyID]<>[ComponentID]
  CK_BillOfMaterials_BOMLevel [ProductAssemblyID] IS NULL AND [BOMLevel]=(0) AND [PerAssemblyQty]=(1.00) OR [ProductAssemblyID] IS NOT NULL AND [BOMLevel]>=(1)
  CK_BillOfMaterials_ProductAssemblyID [ProductAssemblyID]<>[ComponentID]
  CK_BillOfMaterials_EndDate [EndDate]>[StartDate] OR [EndDate] IS NULL
  CK_BillOfMaterials_EndDate [EndDate]>[StartDate] OR [EndDate] IS NULL
  CK_BillOfMaterials_BOMLevel [ProductAssemblyID] IS NULL AND [BOMLevel]=(0) AND [PerAssemblyQty]=(1.00) OR [ProductAssemblyID] IS NOT NULL AND [BOMLevel]>=(1)
  CK_BillOfMaterials_BOMLevel [ProductAssemblyID] IS NULL AND [BOMLevel]=(0) AND [PerAssemblyQty]=(1.00) OR [ProductAssemblyID] IS NOT NULL AND [BOMLevel]>=(1)
  CK_BillOfMaterials_PerAssemblyQty [PerAssemblyQty]>=(1.00)


Table BusinessEntity

Source of the ID that connects vendors, customers, and employees with address and contact information.

IdxField NameData TypeDescription
* BusinessEntityID int AUTOINCREMENT Primary key for all customers, vendors, and employees.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_BusinessEntity_BusinessEntityID ON BusinessEntityID Clustered index created by a primary key constraint.
AK_BusinessEntity_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.


Table BusinessEntityAddress

Cross-reference table mapping customers, vendors, and employees to their addresses.

IdxField NameData TypeDescription
* BusinessEntityID int Primary key. Foreign key to BusinessEntity.BusinessEntityID.
* AddressID int Primary key. Foreign key to Address.AddressID.
* AddressTypeID int Primary key. Foreign key to AddressType.AddressTypeID.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_BusinessEntityAddress_BusinessEntityID_AddressID_AddressTypeID ON BusinessEntityID, AddressID, AddressTypeID Clustered index created by a primary key constraint.
AK_BusinessEntityAddress_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.
IX_BusinessEntityAddress_AddressID ON AddressID Nonclustered index.
IX_BusinessEntityAddress_AddressTypeID ON AddressTypeID Nonclustered index.
Foreign Keys
FK_BusinessEntityAddress_Address_AddressID ( AddressID ) ref Address (AddressID) Foreign key constraint referencing Address.AddressID.
FK_BusinessEntityAddress_AddressType_AddressTypeID ( AddressTypeID ) ref AddressType (AddressTypeID) Foreign key constraint referencing AddressType.AddressTypeID.
FK_BusinessEntityAddress_BusinessEntity_BusinessEntityID ( BusinessEntityID ) ref BusinessEntity (BusinessEntityID) Foreign key constraint referencing BusinessEntity.BusinessEntityID.


Table BusinessEntityContact

Cross-reference table mapping stores, vendors, and employees to people

IdxField NameData TypeDescription
* BusinessEntityID int Primary key. Foreign key to BusinessEntity.BusinessEntityID.
* PersonID int Primary key. Foreign key to Person.BusinessEntityID.
* ContactTypeID int Primary key. Foreign key to ContactType.ContactTypeID.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_BusinessEntityContact_BusinessEntityID_PersonID_ContactTypeID ON BusinessEntityID, PersonID, ContactTypeID Clustered index created by a primary key constraint.
AK_BusinessEntityContact_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.
IX_BusinessEntityContact_ContactTypeID ON ContactTypeID Nonclustered index.
IX_BusinessEntityContact_PersonID ON PersonID Nonclustered index.
Foreign Keys
FK_BusinessEntityContact_BusinessEntity_BusinessEntityID ( BusinessEntityID ) ref BusinessEntity (BusinessEntityID) Foreign key constraint referencing BusinessEntity.BusinessEntityID.
FK_BusinessEntityContact_ContactType_ContactTypeID ( ContactTypeID ) ref ContactType (ContactTypeID) Foreign key constraint referencing ContactType.ContactTypeID.
FK_BusinessEntityContact_Person_PersonID ( PersonID ) ref Person (BusinessEntityID) Foreign key constraint referencing Person.BusinessEntityID.


Table ContactType

Lookup table containing the types of business entity contacts.

IdxField NameData TypeDescription
* ContactTypeID int AUTOINCREMENT Primary key for ContactType records.
* Name name Contact type description.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ContactType_ContactTypeID ON ContactTypeID Clustered index created by a primary key constraint.
AK_ContactType_Name ON Name Unique nonclustered index.


Table CountryRegion

Lookup table containing the ISO standard codes for countries and regions.

IdxField NameData TypeDescription
* CountryRegionCode nvarchar(3) ISO standard code for countries and regions.
* Name name Country or region name.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_CountryRegion_CountryRegionCode ON CountryRegionCode Clustered index created by a primary key constraint.
AK_CountryRegion_Name ON Name Unique nonclustered index.


Table CountryRegionCurrency

Cross-reference table mapping ISO currency codes to a country or region.

IdxField NameData TypeDescription
* CountryRegionCode nvarchar(3) ISO code for countries and regions. Foreign key to CountryRegion.CountryRegionCode.
* CurrencyCode nchar(3) ISO standard currency code. Foreign key to Currency.CurrencyCode.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_CountryRegionCurrency_CountryRegionCode_CurrencyCode ON CountryRegionCode, CurrencyCode Clustered index created by a primary key constraint.
IX_CountryRegionCurrency_CurrencyCode ON CurrencyCode Nonclustered index.
Foreign Keys
FK_CountryRegionCurrency_CountryRegion_CountryRegionCode ( CountryRegionCode ) ref CountryRegion (CountryRegionCode) Foreign key constraint referencing CountryRegion.CountryRegionCode.
FK_CountryRegionCurrency_Currency_CurrencyCode ( CurrencyCode ) ref Currency (CurrencyCode) Foreign key constraint referencing Currency.CurrencyCode.


Table CreditCard

Customer credit card information.

IdxField NameData TypeDescription
* CreditCardID int AUTOINCREMENT Primary key for CreditCard records.
* CardType nvarchar(50) Credit card name.
* CardNumber nvarchar(25) Credit card number.
* ExpMonth tinyint Credit card expiration month.
* ExpYear smallint Credit card expiration year.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_CreditCard_CreditCardID ON CreditCardID Clustered index created by a primary key constraint.
AK_CreditCard_CardNumber ON CardNumber Unique nonclustered index.


Table Culture

Lookup table containing the languages in which some AdventureWorks data is stored.

IdxField NameData TypeDescription
* CultureID nchar(6) Primary key for Culture records.
* Name name Culture description.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_Culture_CultureID ON CultureID Clustered index created by a primary key constraint.
AK_Culture_Name ON Name Unique nonclustered index.


Table Currency

Lookup table containing standard ISO currencies.

IdxField NameData TypeDescription
* CurrencyCode nchar(3) The ISO code for the Currency.
* Name name Currency name.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_Currency_CurrencyCode ON CurrencyCode Clustered index created by a primary key constraint.
AK_Currency_Name ON Name Unique nonclustered index.


Table CurrencyRate

Currency exchange rates.

IdxField NameData TypeDescription
* CurrencyRateID int AUTOINCREMENT Primary key for CurrencyRate records.
* CurrencyRateDate datetime Date and time the exchange rate was obtained.
* FromCurrencyCode nchar(3) Exchange rate was converted from this currency code.
* ToCurrencyCode nchar(3) Exchange rate was converted to this currency code.
* AverageRate money Average exchange rate for the day.
* EndOfDayRate money Final exchange rate for the day.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_CurrencyRate_CurrencyRateID ON CurrencyRateID Clustered index created by a primary key constraint.
AK_CurrencyRate_CurrencyRateDate_FromCurrencyCode_ToCurrencyCode ON CurrencyRateDate, FromCurrencyCode, ToCurrencyCode Unique nonclustered index.
Foreign Keys
FK_CurrencyRate_Currency_FromCurrencyCode ( FromCurrencyCode ) ref Currency (CurrencyCode) Foreign key constraint referencing Currency.FromCurrencyCode.
FK_CurrencyRate_Currency_ToCurrencyCode ( ToCurrencyCode ) ref Currency (CurrencyCode) Foreign key constraint referencing Currency.ToCurrencyCode.


Table Customer

Current customer information. Also see the Person and Store tables.

IdxField NameData TypeDescription
* CustomerID int AUTOINCREMENT Primary key.
PersonID int Foreign key to Person.BusinessEntityID
StoreID int Foreign key to Store.BusinessEntityID
TerritoryID int ID of the territory in which the customer is located. Foreign key to SalesTerritory.SalesTerritoryID.
* AccountNumber varchar(10) Unique number identifying the customer assigned by the accounting system.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_Customer_CustomerID ON CustomerID Clustered index created by a primary key constraint.
AK_Customer_AccountNumber ON AccountNumber Unique nonclustered index.
AK_Customer_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.
IX_Customer_TerritoryID ON TerritoryID Nonclustered index.
Foreign Keys
FK_Customer_Person_PersonID ( PersonID ) ref Person (BusinessEntityID) Foreign key constraint referencing Person.BusinessEntityID.
FK_Customer_SalesTerritory_TerritoryID ( TerritoryID ) ref SalesTerritory (TerritoryID) Foreign key constraint referencing SalesTerritory.TerritoryID.
FK_Customer_Store_StoreID ( StoreID ) ref Store (BusinessEntityID) Foreign key constraint referencing Store.BusinessEntityID.


Table DatabaseLog

Audit table tracking all DDL changes made to the AdventureWorks database. Data is captured by the database trigger ddlDatabaseTriggerLog.

IdxField NameData TypeDescription
* DatabaseLogID int AUTOINCREMENT Primary key for DatabaseLog records.
* PostTime datetime The date and time the DDL change occurred.
* DatabaseUser sysname The user who implemented the DDL change.
* Event sysname The type of DDL statement that was executed.
  Schema sysname The schema to which the changed object belongs.
  Object sysname The object that was changed by the DDL statment.
* TSQL nvarchar(max) The exact Transact-SQL statement that was executed.
* XmlEvent xml The raw XML data generated by database trigger.
Indexes
PK_DatabaseLog_DatabaseLogID ON DatabaseLogID Nonclustered index created by a primary key constraint.


Table Department

Lookup table containing the departments within the Adventure Works Cycles company.

IdxField NameData TypeDescription
* DepartmentID smallint AUTOINCREMENT Primary key for Department records.
* Name name Name of the department.
* GroupName name Name of the group to which the department belongs.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_Department_DepartmentID ON DepartmentID Clustered index created by a primary key constraint.
AK_Department_Name ON Name Unique nonclustered index.


Table Document

Product maintenance documents.

IdxField NameData TypeDescription
* DocumentNode hierarchyid Primary key for Document records.
DocumentLevel smallint Depth in the document hierarchy.
* Title nvarchar(50) Title of the document.
* Owner int Employee who controls the document. Foreign key to Employee.BusinessEntityID
* FolderFlag bit DEFAULT 0 0 = This is a folder, 1 = This is a document.
* FileName nvarchar(400) File name of the document
* FileExtension nvarchar(8) File extension indicating the document type. For example, .doc or .txt.
* Revision nchar(5) Revision number of the document.
* ChangeNumber int DEFAULT 0 Engineering change approval number.
* Status tinyint 1 = Pending approval, 2 = Approved, 3 = Obsolete
  DocumentSummary nvarchar(max) Document abstract.
  Document varbinary(max) Complete document.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Required for FileStream.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_Document_DocumentNode ON DocumentNode Clustered index created by a primary key constraint.
AK_Document_DocumentLevel_DocumentNode ON DocumentLevel, DocumentNode Unique nonclustered index.
UQ__Document__F73921F7C5112C2E ON rowguid
IX_Document_FileName_Revision ON FileName, Revision Unique nonclustered index.
Foreign Keys
FK_Document_Employee_Owner ( Owner ) ref Employee (BusinessEntityID) Foreign key constraint referencing Employee.BusinessEntityID.
Constraints
  CK_Document_Status [Status]>=(1) AND [Status]<=(3)


Table EmailAddress

Where to send a person email.

IdxField NameData TypeDescription
* BusinessEntityID int Primary key. Person associated with this email address. Foreign key to Person.BusinessEntityID
* EmailAddressID int AUTOINCREMENT Primary key. ID of this email address.
EmailAddress nvarchar(50) E-mail address for the person.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_EmailAddress_BusinessEntityID_EmailAddressID ON BusinessEntityID, EmailAddressID Clustered index created by a primary key constraint.
IX_EmailAddress_EmailAddress ON EmailAddress Nonclustered index.
Foreign Keys
FK_EmailAddress_Person_BusinessEntityID ( BusinessEntityID ) ref Person (BusinessEntityID) Foreign key constraint referencing Person.BusinessEntityID.


Table Employee

Employee information such as salary, department, and title.

IdxField NameData TypeDescription
* BusinessEntityID int Primary key for Employee records. Foreign key to BusinessEntity.BusinessEntityID.
* NationalIDNumber nvarchar(15) Unique national identification number such as a social security number.
* LoginID nvarchar(256) Network login.
OrganizationNode hierarchyid Where the employee is located in corporate hierarchy.
OrganizationLevel smallint The depth of the employee in the corporate hierarchy.
* JobTitle nvarchar(50) Work title such as Buyer or Sales Representative.
* BirthDate date Date of birth.
* MaritalStatus nchar(1) M = Married, S = Single
* Gender nchar(1) M = Male, F = Female
* HireDate date Employee hired on this date.
* SalariedFlag flag DEFAULT 1 Job classification. 0 = Hourly, not exempt from collective bargaining. 1 = Salaried, exempt from collective bargaining.
* VacationHours smallint DEFAULT 0 Number of available vacation hours.
* SickLeaveHours smallint DEFAULT 0 Number of available sick leave hours.
* CurrentFlag flag DEFAULT 1 0 = Inactive, 1 = Active
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_Employee_BusinessEntityID ON BusinessEntityID Clustered index created by a primary key constraint.
AK_Employee_LoginID ON LoginID Unique nonclustered index.
AK_Employee_NationalIDNumber ON NationalIDNumber Unique nonclustered index.
AK_Employee_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.
IX_Employee_OrganizationLevel_OrganizationNode ON OrganizationLevel, OrganizationNode Unique nonclustered index.
IX_Employee_OrganizationNode ON OrganizationNode Unique nonclustered index.
Foreign Keys
FK_Employee_Person_BusinessEntityID ( BusinessEntityID ) ref Person (BusinessEntityID) Foreign key constraint referencing Person.BusinessEntityID.
Constraints
  CK_Employee_BirthDate [BirthDate]>='1930-01-01' AND [BirthDate]<=dateadd(year,(-18),getdate())
  CK_Employee_MaritalStatus upper([MaritalStatus])='S' OR upper([MaritalStatus])='M'
  CK_Employee_Gender upper([Gender])='F' OR upper([Gender])='M'
  CK_Employee_HireDate [HireDate]>='1996-07-01' AND [HireDate]<=dateadd(day,(1),getdate())
  CK_Employee_VacationHours [VacationHours]>=(-40) AND [VacationHours]<=(240)
  CK_Employee_SickLeaveHours [SickLeaveHours]>=(0) AND [SickLeaveHours]<=(120)
Triggers
  dEmployee


Table EmployeeDepartmentHistory

Employee department transfers.

IdxField NameData TypeDescription
* BusinessEntityID int Employee identification number. Foreign key to Employee.BusinessEntityID.
* StartDate date Date the employee started work in the department.
* DepartmentID smallint Department in which the employee worked including currently. Foreign key to Department.DepartmentID.
* ShiftID tinyint Identifies which 8-hour shift the employee works. Foreign key to Shift.Shift.ID.
  EndDate date Date the employee left the department. NULL = Current department.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_EmployeeDepartmentHistory_BusinessEntityID_StartDate_DepartmentID ON BusinessEntityID, StartDate, DepartmentID, ShiftID Clustered index created by a primary key constraint.
IX_EmployeeDepartmentHistory_DepartmentID ON DepartmentID Nonclustered index.
IX_EmployeeDepartmentHistory_ShiftID ON ShiftID Nonclustered index.
Foreign Keys
FK_EmployeeDepartmentHistory_Department_DepartmentID ( DepartmentID ) ref Department (DepartmentID) Foreign key constraint referencing Department.DepartmentID.
FK_EmployeeDepartmentHistory_Employee_BusinessEntityID ( BusinessEntityID ) ref Employee (BusinessEntityID) Foreign key constraint referencing Employee.EmployeeID.
FK_EmployeeDepartmentHistory_Shift_ShiftID ( ShiftID ) ref Shift (ShiftID) Foreign key constraint referencing Shift.ShiftID
Constraints
  CK_EmployeeDepartmentHistory_EndDate [EndDate]>=[StartDate] OR [EndDate] IS NULL
  CK_EmployeeDepartmentHistory_EndDate [EndDate]>=[StartDate] OR [EndDate] IS NULL


Table EmployeePayHistory

Employee pay history.

IdxField NameData TypeDescription
* BusinessEntityID int Employee identification number. Foreign key to Employee.BusinessEntityID.
* RateChangeDate datetime Date the change in pay is effective
* Rate money Salary hourly rate.
* PayFrequency tinyint 1 = Salary received monthly, 2 = Salary received biweekly
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_EmployeePayHistory_BusinessEntityID_RateChangeDate ON BusinessEntityID, RateChangeDate Clustered index created by a primary key constraint.
Foreign Keys
FK_EmployeePayHistory_Employee_BusinessEntityID ( BusinessEntityID ) ref Employee (BusinessEntityID) Foreign key constraint referencing Employee.EmployeeID.
Constraints
  CK_EmployeePayHistory_Rate [Rate]>=(6.50) AND [Rate]<=(200.00)
  CK_EmployeePayHistory_PayFrequency [PayFrequency]=(2) OR [PayFrequency]=(1)


Table ErrorLog

Audit table tracking errors in the the AdventureWorks database that are caught by the CATCH block of a TRY...CATCH construct. Data is inserted by stored procedure dbo.uspLogError when it is executed from inside the CATCH block of a TRY...CATCH construct.

IdxField NameData TypeDescription
* ErrorLogID int AUTOINCREMENT Primary key for ErrorLog records.
* ErrorTime datetime DEFAULT getdate() The date and time at which the error occurred.
* UserName sysname The user who executed the batch in which the error occurred.
* ErrorNumber int The error number of the error that occurred.
  ErrorSeverity int The severity of the error that occurred.
  ErrorState int The state number of the error that occurred.
  ErrorProcedure nvarchar(126) The name of the stored procedure or trigger where the error occurred.
  ErrorLine int The line number at which the error occurred.
* ErrorMessage nvarchar(4000) The message text of the error that occurred.
Indexes
PK_ErrorLog_ErrorLogID ON ErrorLogID Clustered index created by a primary key constraint.


Table Illustration

Bicycle assembly diagrams.

IdxField NameData TypeDescription
* IllustrationID int AUTOINCREMENT Primary key for Illustration records.
  Diagram xml Illustrations used in manufacturing instructions. Stored as XML.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_Illustration_IllustrationID ON IllustrationID Clustered index created by a primary key constraint.


Table JobCandidate

Résumés submitted to Human Resources by job applicants.

IdxField NameData TypeDescription
* JobCandidateID int AUTOINCREMENT Primary key for JobCandidate records.
BusinessEntityID int Employee identification number if applicant was hired. Foreign key to Employee.BusinessEntityID.
  Resume xml Résumé in XML format.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_JobCandidate_JobCandidateID ON JobCandidateID Clustered index created by a primary key constraint.
IX_JobCandidate_BusinessEntityID ON BusinessEntityID Nonclustered index.
Foreign Keys
FK_JobCandidate_Employee_BusinessEntityID ( BusinessEntityID ) ref Employee (BusinessEntityID) Foreign key constraint referencing Employee.EmployeeID.


Table Location

Product inventory and manufacturing locations.

IdxField NameData TypeDescription
* LocationID smallint AUTOINCREMENT Primary key for Location records.
* Name name Location description.
* CostRate smallmoney DEFAULT 0.00 Standard hourly cost of the manufacturing location.
* Availability decimal(8,2) DEFAULT 0.00 Work capacity (in hours) of the manufacturing location.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_Location_LocationID ON LocationID Clustered index created by a primary key constraint.
AK_Location_Name ON Name Unique nonclustered index.
Constraints
  CK_Location_CostRate [CostRate]>=(0.00)
  CK_Location_Availability [Availability]>=(0.00)


Table Password

One way hashed authentication information

IdxField NameData TypeDescription
* BusinessEntityID int
* PasswordHash varchar(128) Password for the e-mail account.
* PasswordSalt varchar(10) Random value concatenated with the password string before the password is hashed.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_Password_BusinessEntityID ON BusinessEntityID Clustered index created by a primary key constraint.
Foreign Keys
FK_Password_Person_BusinessEntityID ( BusinessEntityID ) ref Person (BusinessEntityID) Foreign key constraint referencing Person.BusinessEntityID.


Table Person

Human beings involved with AdventureWorks: employees, customer contacts, and vendor contacts.

IdxField NameData TypeDescription
* BusinessEntityID int Primary key for Person records.
* PersonType nchar(2) Primary type of person: SC = Store Contact, IN = Individual (retail) customer, SP = Sales person, EM = Employee (non-sales), VC = Vendor contact, GC = General contact
* NameStyle namestyle DEFAULT 0 0 = The data in FirstName and LastName are stored in western style (first name, last name) order. 1 = Eastern style (last name, first name) order.
  Title nvarchar(8) A courtesy title. For example, Mr. or Ms.
* FirstName name First name of the person.
MiddleName name Middle name or middle initial of the person.
* LastName name Last name of the person.
  Suffix nvarchar(10) Surname suffix. For example, Sr. or Jr.
* EmailPromotion int DEFAULT 0 0 = Contact does not wish to receive e-mail promotions, 1 = Contact does wish to receive e-mail promotions from AdventureWorks, 2 = Contact does wish to receive e-mail promotions from AdventureWorks and selected partners.
  AdditionalContactInfo xml Additional contact information about the person stored in xml format.
  Demographics xml Personal information such as hobbies, and income collected from online shoppers. Used for sales analysis.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_Person_BusinessEntityID ON BusinessEntityID Clustered index created by a primary key constraint.
AK_Person_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.
IX_Person_LastName_FirstName_MiddleName ON LastName, FirstName, MiddleName
Foreign Keys
FK_Person_BusinessEntity_BusinessEntityID ( BusinessEntityID ) ref BusinessEntity (BusinessEntityID) Foreign key constraint referencing BusinessEntity.BusinessEntityID.
Constraints
  CK_Person_PersonType [PersonType] IS NULL OR (upper([PersonType])='GC' OR upper([PersonType])='SP' OR upper([PersonType])='EM' OR upper([PersonType])='IN' OR upper([PersonType])='VC' OR upper([PersonType])='SC')
  CK_Person_EmailPromotion [EmailPromotion]>=(0) AND [EmailPromotion]<=(2)
Triggers
  iuPerson


Table PersonCreditCard

Cross-reference table mapping people to their credit card information in the CreditCard table.

IdxField NameData TypeDescription
* BusinessEntityID int Business entity identification number. Foreign key to Person.BusinessEntityID.
* CreditCardID int Credit card identification number. Foreign key to CreditCard.CreditCardID.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_PersonCreditCard_BusinessEntityID_CreditCardID ON BusinessEntityID, CreditCardID Clustered index created by a primary key constraint.
Foreign Keys
FK_PersonCreditCard_CreditCard_CreditCardID ( CreditCardID ) ref CreditCard (CreditCardID) Foreign key constraint referencing CreditCard.CreditCardID.
FK_PersonCreditCard_Person_BusinessEntityID ( BusinessEntityID ) ref Person (BusinessEntityID) Foreign key constraint referencing Person.BusinessEntityID.


Table PersonPhone

Telephone number and type of a person.

IdxField NameData TypeDescription
* BusinessEntityID int Business entity identification number. Foreign key to Person.BusinessEntityID.
* PhoneNumber phone Telephone number identification number.
* PhoneNumberTypeID int Kind of phone number. Foreign key to PhoneNumberType.PhoneNumberTypeID.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_PersonPhone_BusinessEntityID_PhoneNumber_PhoneNumberTypeID ON BusinessEntityID, PhoneNumber, PhoneNumberTypeID Clustered index created by a primary key constraint.
IX_PersonPhone_PhoneNumber ON PhoneNumber Nonclustered index.
Foreign Keys
FK_PersonPhone_Person_BusinessEntityID ( BusinessEntityID ) ref Person (BusinessEntityID) Foreign key constraint referencing Person.BusinessEntityID.
FK_PersonPhone_PhoneNumberType_PhoneNumberTypeID ( PhoneNumberTypeID ) ref PhoneNumberType (PhoneNumberTypeID) Foreign key constraint referencing PhoneNumberType.PhoneNumberTypeID.


Table PhoneNumberType

Type of phone number of a person.

IdxField NameData TypeDescription
* PhoneNumberTypeID int AUTOINCREMENT Primary key for telephone number type records.
* Name name Name of the telephone number type
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_PhoneNumberType_PhoneNumberTypeID ON PhoneNumberTypeID Clustered index created by a primary key constraint.


Table Product

Products sold or used in the manfacturing of sold products.

IdxField NameData TypeDescription
* ProductID int AUTOINCREMENT Primary key for Product records.
* Name name Name of the product.
* ProductNumber nvarchar(25) Unique product identification number.
* MakeFlag flag DEFAULT 1 0 = Product is purchased, 1 = Product is manufactured in-house.
* FinishedGoodsFlag flag DEFAULT 1 0 = Product is not a salable item. 1 = Product is salable.
  Color nvarchar(15) Product color.
* SafetyStockLevel smallint Minimum inventory quantity.
* ReorderPoint smallint Inventory level that triggers a purchase order or work order.
* StandardCost money Standard cost of the product.
* ListPrice money Selling price.
  Size nvarchar(5) Product size.
SizeUnitMeasureCode nchar(3) Unit of measure for Size column.
WeightUnitMeasureCode nchar(3) Unit of measure for Weight column.
  Weight decimal(8,2) Product weight.
* DaysToManufacture int Number of days required to manufacture the product.
  ProductLine nchar(2) R = Road, M = Mountain, T = Touring, S = Standard
  Class nchar(2) H = High, M = Medium, L = Low
  Style nchar(2) W = Womens, M = Mens, U = Universal
ProductSubcategoryID int Product is a member of this product subcategory. Foreign key to ProductSubCategory.ProductSubCategoryID.
ProductModelID int Product is a member of this product model. Foreign key to ProductModel.ProductModelID.
* SellStartDate datetime Date the product was available for sale.
  SellEndDate datetime Date the product was no longer available for sale.
  DiscontinuedDate datetime Date the product was discontinued.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_Product_ProductID ON ProductID Clustered index created by a primary key constraint.
AK_Product_Name ON Name Unique nonclustered index.
AK_Product_ProductNumber ON ProductNumber Unique nonclustered index.
AK_Product_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.
Foreign Keys
FK_Product_ProductModel_ProductModelID ( ProductModelID ) ref ProductModel (ProductModelID) Foreign key constraint referencing ProductModel.ProductModelID.
FK_Product_ProductSubcategory_ProductSubcategoryID ( ProductSubcategoryID ) ref ProductSubcategory (ProductSubcategoryID) Foreign key constraint referencing ProductSubcategory.ProductSubcategoryID.
FK_Product_UnitMeasure_SizeUnitMeasureCode ( SizeUnitMeasureCode ) ref UnitMeasure (UnitMeasureCode) Foreign key constraint referencing UnitMeasure.UnitMeasureCode.
FK_Product_UnitMeasure_WeightUnitMeasureCode ( WeightUnitMeasureCode ) ref UnitMeasure (UnitMeasureCode) Foreign key constraint referencing UnitMeasure.UnitMeasureCode.
Constraints
  CK_Product_SafetyStockLevel [SafetyStockLevel]>(0)
  CK_Product_ReorderPoint [ReorderPoint]>(0)
  CK_Product_StandardCost [StandardCost]>=(0.00)
  CK_Product_ListPrice [ListPrice]>=(0.00)
  CK_Product_Weight [Weight]>(0.00)
  CK_Product_DaysToManufacture [DaysToManufacture]>=(0)
  CK_Product_ProductLine upper([ProductLine])='R' OR upper([ProductLine])='M' OR upper([ProductLine])='T' OR upper([ProductLine])='S' OR [ProductLine] IS NULL
  CK_Product_Class upper([Class])='H' OR upper([Class])='M' OR upper([Class])='L' OR [Class] IS NULL
  CK_Product_Style upper([Style])='U' OR upper([Style])='M' OR upper([Style])='W' OR [Style] IS NULL
  CK_Product_SellEndDate [SellEndDate]>=[SellStartDate] OR [SellEndDate] IS NULL
  CK_Product_SellEndDate [SellEndDate]>=[SellStartDate] OR [SellEndDate] IS NULL


Table ProductCategory

High-level product categorization.

IdxField NameData TypeDescription
* ProductCategoryID int AUTOINCREMENT Primary key for ProductCategory records.
* Name name Category description.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductCategory_ProductCategoryID ON ProductCategoryID Clustered index created by a primary key constraint.
AK_ProductCategory_Name ON Name Unique nonclustered index.
AK_ProductCategory_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.


Table ProductCostHistory

Changes in the cost of a product over time.

IdxField NameData TypeDescription
* ProductID int Product identification number. Foreign key to Product.ProductID
* StartDate datetime Product cost start date.
  EndDate datetime Product cost end date.
* StandardCost money Standard cost of the product.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductCostHistory_ProductID_StartDate ON ProductID, StartDate Clustered index created by a primary key constraint.
Foreign Keys
FK_ProductCostHistory_Product_ProductID ( ProductID ) ref Product (ProductID) Foreign key constraint referencing Product.ProductID.
Constraints
  CK_ProductCostHistory_EndDate [EndDate]>=[StartDate] OR [EndDate] IS NULL
  CK_ProductCostHistory_EndDate [EndDate]>=[StartDate] OR [EndDate] IS NULL
  CK_ProductCostHistory_StandardCost [StandardCost]>=(0.00)


Table ProductDescription

Product descriptions in several languages.

IdxField NameData TypeDescription
* ProductDescriptionID int AUTOINCREMENT Primary key for ProductDescription records.
* Description nvarchar(400) Description of the product.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductDescription_ProductDescriptionID ON ProductDescriptionID Clustered index created by a primary key constraint.
AK_ProductDescription_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.


Table ProductDocument

Cross-reference table mapping products to related product documents.

IdxField NameData TypeDescription
* ProductID int Product identification number. Foreign key to Product.ProductID.
* DocumentNode hierarchyid Document identification number. Foreign key to Document.DocumentNode.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductDocument_ProductID_DocumentNode ON ProductID, DocumentNode Clustered index created by a primary key constraint.
Foreign Keys
FK_ProductDocument_Document_DocumentNode ( DocumentNode ) ref Document (DocumentNode) Foreign key constraint referencing Document.DocumentNode.
FK_ProductDocument_Product_ProductID ( ProductID ) ref Product (ProductID) Foreign key constraint referencing Product.ProductID.


Table ProductInventory

Product inventory information.

IdxField NameData TypeDescription
* ProductID int Product identification number. Foreign key to Product.ProductID.
* LocationID smallint Inventory location identification number. Foreign key to Location.LocationID.
* Shelf nvarchar(10) Storage compartment within an inventory location.
* Bin tinyint Storage container on a shelf in an inventory location.
* Quantity smallint DEFAULT 0 Quantity of products in the inventory location.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductInventory_ProductID_LocationID ON ProductID, LocationID Clustered index created by a primary key constraint.
Foreign Keys
FK_ProductInventory_Location_LocationID ( LocationID ) ref Location (LocationID) Foreign key constraint referencing Location.LocationID.
FK_ProductInventory_Product_ProductID ( ProductID ) ref Product (ProductID) Foreign key constraint referencing Product.ProductID.
Constraints
  CK_ProductInventory_Shelf [Shelf] like '[A-Za-z]' OR [Shelf]='N/A'
  CK_ProductInventory_Bin [Bin]>=(0) AND [Bin]<=(100)


Table ProductListPriceHistory

Changes in the list price of a product over time.

IdxField NameData TypeDescription
* ProductID int Product identification number. Foreign key to Product.ProductID
* StartDate datetime List price start date.
  EndDate datetime List price end date
* ListPrice money Product list price.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductListPriceHistory_ProductID_StartDate ON ProductID, StartDate Clustered index created by a primary key constraint.
Foreign Keys
FK_ProductListPriceHistory_Product_ProductID ( ProductID ) ref Product (ProductID) Foreign key constraint referencing Product.ProductID.
Constraints
  CK_ProductListPriceHistory_EndDate [EndDate]>=[StartDate] OR [EndDate] IS NULL
  CK_ProductListPriceHistory_EndDate [EndDate]>=[StartDate] OR [EndDate] IS NULL
  CK_ProductListPriceHistory_ListPrice [ListPrice]>(0.00)


Table ProductModel

Product model classification.

IdxField NameData TypeDescription
* ProductModelID int AUTOINCREMENT Primary key for ProductModel records.
* Name name Product model description.
  CatalogDescription xml Detailed product catalog information in xml format.
  Instructions xml Manufacturing instructions in xml format.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductModel_ProductModelID ON ProductModelID Clustered index created by a primary key constraint.
AK_ProductModel_Name ON Name Unique nonclustered index.
AK_ProductModel_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.


Table ProductModelIllustration

Cross-reference table mapping product models and illustrations.

IdxField NameData TypeDescription
* ProductModelID int Primary key. Foreign key to ProductModel.ProductModelID.
* IllustrationID int Primary key. Foreign key to Illustration.IllustrationID.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductModelIllustration_ProductModelID_IllustrationID ON ProductModelID, IllustrationID Clustered index created by a primary key constraint.
Foreign Keys
FK_ProductModelIllustration_Illustration_IllustrationID ( IllustrationID ) ref Illustration (IllustrationID) Foreign key constraint referencing Illustration.IllustrationID.
FK_ProductModelIllustration_ProductModel_ProductModelID ( ProductModelID ) ref ProductModel (ProductModelID) Foreign key constraint referencing ProductModel.ProductModelID.


Table ProductModelProductDescriptionCulture

Cross-reference table mapping product descriptions and the language the description is written in.

IdxField NameData TypeDescription
* ProductModelID int Primary key. Foreign key to ProductModel.ProductModelID.
* ProductDescriptionID int Primary key. Foreign key to ProductDescription.ProductDescriptionID.
* CultureID nchar(6) Culture identification number. Foreign key to Culture.CultureID.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductModelProductDescriptionCulture_ProductModelID_ProductDescriptionID_CultureID ON ProductModelID, ProductDescriptionID, CultureID Clustered index created by a primary key constraint.
Foreign Keys
FK_ProductModelProductDescriptionCulture_Culture_CultureID ( CultureID ) ref Culture (CultureID) Foreign key constraint referencing Culture.CultureID.
FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID ( ProductDescriptionID ) ref ProductDescription (ProductDescriptionID) Foreign key constraint referencing ProductDescription.ProductDescriptionID.
FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID ( ProductModelID ) ref ProductModel (ProductModelID) Foreign key constraint referencing ProductModel.ProductModelID.


Table ProductPhoto

Product images.

IdxField NameData TypeDescription
* ProductPhotoID int AUTOINCREMENT Primary key for ProductPhoto records.
  ThumbNailPhoto varbinary(max) Small image of the product.
  ThumbnailPhotoFileName nvarchar(50) Small image file name.
  LargePhoto varbinary(max) Large image of the product.
  LargePhotoFileName nvarchar(50) Large image file name.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductPhoto_ProductPhotoID ON ProductPhotoID Clustered index created by a primary key constraint.


Table ProductProductPhoto

Cross-reference table mapping products and product photos.

IdxField NameData TypeDescription
* ProductID int Product identification number. Foreign key to Product.ProductID.
* ProductPhotoID int Product photo identification number. Foreign key to ProductPhoto.ProductPhotoID.
* Primary flag DEFAULT 0 0 = Photo is not the principal image. 1 = Photo is the principal image.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductProductPhoto_ProductID_ProductPhotoID ON ProductID, ProductPhotoID Nonclustered index created by a primary key constraint.
Foreign Keys
FK_ProductProductPhoto_Product_ProductID ( ProductID ) ref Product (ProductID) Foreign key constraint referencing Product.ProductID.
FK_ProductProductPhoto_ProductPhoto_ProductPhotoID ( ProductPhotoID ) ref ProductPhoto (ProductPhotoID) Foreign key constraint referencing ProductPhoto.ProductPhotoID.


Table ProductReview

Customer reviews of products they have purchased.

IdxField NameData TypeDescription
* ProductReviewID int AUTOINCREMENT Primary key for ProductReview records.
* ProductID int Product identification number. Foreign key to Product.ProductID.
* ReviewerName name Name of the reviewer.
* ReviewDate datetime DEFAULT getdate() Date review was submitted.
* EmailAddress nvarchar(50) Reviewer's e-mail address.
* Rating int Product rating given by the reviewer. Scale is 1 to 5 with 5 as the highest rating.
  Comments nvarchar(3850) Reviewer's comments
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductReview_ProductReviewID ON ProductReviewID Clustered index created by a primary key constraint.
IX_ProductReview_ProductID_Name ON ProductID, ReviewerName Nonclustered index.
Foreign Keys
FK_ProductReview_Product_ProductID ( ProductID ) ref Product (ProductID) Foreign key constraint referencing Product.ProductID.
Constraints
  CK_ProductReview_Rating [Rating]>=(1) AND [Rating]<=(5)


Table ProductSubcategory

Product subcategories. See ProductCategory table.

IdxField NameData TypeDescription
* ProductSubcategoryID int AUTOINCREMENT Primary key for ProductSubcategory records.
* ProductCategoryID int Product category identification number. Foreign key to ProductCategory.ProductCategoryID.
* Name name Subcategory description.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductSubcategory_ProductSubcategoryID ON ProductSubcategoryID Clustered index created by a primary key constraint.
AK_ProductSubcategory_Name ON Name Unique nonclustered index.
AK_ProductSubcategory_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.
Foreign Keys
FK_ProductSubcategory_ProductCategory_ProductCategoryID ( ProductCategoryID ) ref ProductCategory (ProductCategoryID) Foreign key constraint referencing ProductCategory.ProductCategoryID.


Table ProductVendor

Cross-reference table mapping vendors with the products they supply.

IdxField NameData TypeDescription
* ProductID int Primary key. Foreign key to Product.ProductID.
* BusinessEntityID int Primary key. Foreign key to Vendor.BusinessEntityID.
* AverageLeadTime int The average span of time (in days) between placing an order with the vendor and receiving the purchased product.
* StandardPrice money The vendor's usual selling price.
  LastReceiptCost money The selling price when last purchased.
  LastReceiptDate datetime Date the product was last received by the vendor.
* MinOrderQty int The maximum quantity that should be ordered.
* MaxOrderQty int The minimum quantity that should be ordered.
  OnOrderQty int The quantity currently on order.
* UnitMeasureCode nchar(3) The product's unit of measure.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductVendor_ProductID_BusinessEntityID ON ProductID, BusinessEntityID Clustered index created by a primary key constraint.
IX_ProductVendor_BusinessEntityID ON BusinessEntityID Nonclustered index.
IX_ProductVendor_UnitMeasureCode ON UnitMeasureCode Nonclustered index.
Foreign Keys
FK_ProductVendor_Product_ProductID ( ProductID ) ref Product (ProductID) Foreign key constraint referencing Product.ProductID.
FK_ProductVendor_UnitMeasure_UnitMeasureCode ( UnitMeasureCode ) ref UnitMeasure (UnitMeasureCode) Foreign key constraint referencing UnitMeasure.UnitMeasureCode.
FK_ProductVendor_Vendor_BusinessEntityID ( BusinessEntityID ) ref Vendor (BusinessEntityID) Foreign key constraint referencing Vendor.BusinessEntityID.
Constraints
  CK_ProductVendor_AverageLeadTime [AverageLeadTime]>=(1)
  CK_ProductVendor_StandardPrice [StandardPrice]>(0.00)
  CK_ProductVendor_LastReceiptCost [LastReceiptCost]>(0.00)
  CK_ProductVendor_MinOrderQty [MinOrderQty]>=(1)
  CK_ProductVendor_MaxOrderQty [MaxOrderQty]>=(1)
  CK_ProductVendor_OnOrderQty [OnOrderQty]>=(0)


Table PurchaseOrderDetail

Individual products associated with a specific purchase order. See PurchaseOrderHeader.

IdxField NameData TypeDescription
* PurchaseOrderID int Primary key. Foreign key to PurchaseOrderHeader.PurchaseOrderID.
* PurchaseOrderDetailID int AUTOINCREMENT Primary key. One line number per purchased product.
* DueDate datetime Date the product is expected to be received.
* OrderQty smallint Quantity ordered.
* ProductID int Product identification number. Foreign key to Product.ProductID.
* UnitPrice money Vendor's selling price of a single product.
* LineTotal money Per product subtotal. Computed as OrderQty * UnitPrice.
* ReceivedQty decimal(8,2) Quantity actually received from the vendor.
* RejectedQty decimal(8,2) Quantity rejected during inspection.
* StockedQty decimal(9,2) Quantity accepted into inventory. Computed as ReceivedQty - RejectedQty.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_PurchaseOrderDetail_PurchaseOrderID_PurchaseOrderDetailID ON PurchaseOrderID, PurchaseOrderDetailID Clustered index created by a primary key constraint.
IX_PurchaseOrderDetail_ProductID ON ProductID Nonclustered index.
Foreign Keys
FK_PurchaseOrderDetail_Product_ProductID ( ProductID ) ref Product (ProductID) Foreign key constraint referencing Product.ProductID.
FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID ( PurchaseOrderID ) ref PurchaseOrderHeader (PurchaseOrderID) Foreign key constraint referencing PurchaseOrderHeader.PurchaseOrderID.
Constraints
  CK_PurchaseOrderDetail_OrderQty [OrderQty]>(0)
  CK_PurchaseOrderDetail_UnitPrice [UnitPrice]>=(0.00)
  CK_PurchaseOrderDetail_ReceivedQty [ReceivedQty]>=(0.00)
  CK_PurchaseOrderDetail_RejectedQty [RejectedQty]>=(0.00)
Triggers
  iPurchaseOrderDetail
  uPurchaseOrderDetail


Table PurchaseOrderHeader

General purchase order information. See PurchaseOrderDetail.

IdxField NameData TypeDescription
* PurchaseOrderID int AUTOINCREMENT Primary key.
* RevisionNumber tinyint DEFAULT 0 Incremental number to track changes to the purchase order over time.
* Status tinyint DEFAULT 1 Order current status. 1 = Pending; 2 = Approved; 3 = Rejected; 4 = Complete
* EmployeeID int Employee who created the purchase order. Foreign key to Employee.BusinessEntityID.
* VendorID int Vendor with whom the purchase order is placed. Foreign key to Vendor.BusinessEntityID.
* ShipMethodID int Shipping method. Foreign key to ShipMethod.ShipMethodID.
* OrderDate datetime DEFAULT getdate() Purchase order creation date.
  ShipDate datetime Estimated shipment date from the vendor.
* SubTotal money DEFAULT 0.00 Purchase order subtotal. Computed as SUM(PurchaseOrderDetail.LineTotal)for the appropriate PurchaseOrderID.
* TaxAmt money DEFAULT 0.00 Tax amount.
* Freight money DEFAULT 0.00 Shipping cost.
* TotalDue money Total due to vendor. Computed as Subtotal + TaxAmt + Freight.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_PurchaseOrderHeader_PurchaseOrderID ON PurchaseOrderID Clustered index created by a primary key constraint.
IX_PurchaseOrderHeader_EmployeeID ON EmployeeID Nonclustered index.
IX_PurchaseOrderHeader_VendorID ON VendorID Nonclustered index.
Foreign Keys
FK_PurchaseOrderHeader_Employee_EmployeeID ( EmployeeID ) ref Employee (BusinessEntityID) Foreign key constraint referencing Employee.EmployeeID.
FK_PurchaseOrderHeader_ShipMethod_ShipMethodID ( ShipMethodID ) ref ShipMethod (ShipMethodID) Foreign key constraint referencing ShipMethod.ShipMethodID.
FK_PurchaseOrderHeader_Vendor_VendorID ( VendorID ) ref Vendor (BusinessEntityID) Foreign key constraint referencing Vendor.VendorID.
Constraints
  CK_PurchaseOrderHeader_Status [Status]>=(1) AND [Status]<=(4)
  CK_PurchaseOrderHeader_ShipDate [ShipDate]>=[OrderDate] OR [ShipDate] IS NULL
  CK_PurchaseOrderHeader_ShipDate [ShipDate]>=[OrderDate] OR [ShipDate] IS NULL
  CK_PurchaseOrderHeader_SubTotal [SubTotal]>=(0.00)
  CK_PurchaseOrderHeader_TaxAmt [TaxAmt]>=(0.00)
  CK_PurchaseOrderHeader_Freight [Freight]>=(0.00)
Triggers
  uPurchaseOrderHeader


Table SalesOrderDetail

Individual products associated with a specific sales order. See SalesOrderHeader.

IdxField NameData TypeDescription
* SalesOrderID int Primary key. Foreign key to SalesOrderHeader.SalesOrderID.
* SalesOrderDetailID int AUTOINCREMENT Primary key. One incremental unique number per product sold.
  CarrierTrackingNumber nvarchar(25) Shipment tracking number supplied by the shipper.
* OrderQty smallint Quantity ordered per product.
* ProductID int Product sold to customer. Foreign key to Product.ProductID.
* SpecialOfferID int Promotional code. Foreign key to SpecialOffer.SpecialOfferID.
* UnitPrice money Selling price of a single product.
* UnitPriceDiscount money DEFAULT 0.0 Discount amount.
* LineTotal numeric(38,6) Per product subtotal. Computed as UnitPrice * (1 - UnitPriceDiscount) * OrderQty.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID ON SalesOrderID, SalesOrderDetailID Clustered index created by a primary key constraint.
AK_SalesOrderDetail_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.
IX_SalesOrderDetail_ProductID ON ProductID Nonclustered index.
Foreign Keys
FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID ( SalesOrderID ) ref SalesOrderHeader (SalesOrderID) Foreign key constraint referencing SalesOrderHeader.PurchaseOrderID.
FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID ( SpecialOfferID, ProductID ) ref SpecialOfferProduct (SpecialOfferID, ProductID) Foreign key constraint referencing SpecialOfferProduct.SpecialOfferIDProductID.
Constraints
  CK_SalesOrderDetail_OrderQty [OrderQty]>(0)
  CK_SalesOrderDetail_UnitPrice [UnitPrice]>=(0.00)
  CK_SalesOrderDetail_UnitPriceDiscount [UnitPriceDiscount]>=(0.00)
Triggers
  iduSalesOrderDetail


Table SalesOrderHeader

General sales order information.

IdxField NameData TypeDescription
* SalesOrderID int AUTOINCREMENT Primary key.
* RevisionNumber tinyint DEFAULT 0 Incremental number to track changes to the sales order over time.
* OrderDate datetime DEFAULT getdate() Dates the sales order was created.
* DueDate datetime Date the order is due to the customer.
  ShipDate datetime Date the order was shipped to the customer.
* Status tinyint DEFAULT 1 Order current status. 1 = In process; 2 = Approved; 3 = Backordered; 4 = Rejected; 5 = Shipped; 6 = Cancelled
* OnlineOrderFlag flag DEFAULT 1 0 = Order placed by sales person. 1 = Order placed online by customer.
* SalesOrderNumber nvarchar(25) Unique sales order identification number.
  PurchaseOrderNumber ordernumber Customer purchase order number reference.
  AccountNumber accountnumber Financial accounting number reference.
* CustomerID int Customer identification number. Foreign key to Customer.BusinessEntityID.
SalesPersonID int Sales person who created the sales order. Foreign key to SalesPerson.BusinessEntityID.
TerritoryID int Territory in which the sale was made. Foreign key to SalesTerritory.SalesTerritoryID.
* BillToAddressID int Customer billing address. Foreign key to Address.AddressID.
* ShipToAddressID int Customer shipping address. Foreign key to Address.AddressID.
* ShipMethodID int Shipping method. Foreign key to ShipMethod.ShipMethodID.
CreditCardID int Credit card identification number. Foreign key to CreditCard.CreditCardID.
  CreditCardApprovalCode varchar(15) Approval code provided by the credit card company.
CurrencyRateID int Currency exchange rate used. Foreign key to CurrencyRate.CurrencyRateID.
* SubTotal money DEFAULT 0.00 Sales subtotal. Computed as SUM(SalesOrderDetail.LineTotal)for the appropriate SalesOrderID.
* TaxAmt money DEFAULT 0.00 Tax amount.
* Freight money DEFAULT 0.00 Shipping cost.
* TotalDue money Total due from customer. Computed as Subtotal + TaxAmt + Freight.
  Comment nvarchar(128) Sales representative comments.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_SalesOrderHeader_SalesOrderID ON SalesOrderID Clustered index created by a primary key constraint.
AK_SalesOrderHeader_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.
AK_SalesOrderHeader_SalesOrderNumber ON SalesOrderNumber Unique nonclustered index.
IX_SalesOrderHeader_CustomerID ON CustomerID Nonclustered index.
IX_SalesOrderHeader_SalesPersonID ON SalesPersonID Nonclustered index.
Foreign Keys
FK_SalesOrderHeader_Address_BillToAddressID ( BillToAddressID ) ref Address (AddressID) Foreign key constraint referencing Address.AddressID.
FK_SalesOrderHeader_Address_ShipToAddressID ( ShipToAddressID ) ref Address (AddressID) Foreign key constraint referencing Address.AddressID.
FK_SalesOrderHeader_CreditCard_CreditCardID ( CreditCardID ) ref CreditCard (CreditCardID) Foreign key constraint referencing CreditCard.CreditCardID.
FK_SalesOrderHeader_CurrencyRate_CurrencyRateID ( CurrencyRateID ) ref CurrencyRate (CurrencyRateID) Foreign key constraint referencing CurrencyRate.CurrencyRateID.
FK_SalesOrderHeader_Customer_CustomerID ( CustomerID ) ref Customer (CustomerID) Foreign key constraint referencing Customer.CustomerID.
FK_SalesOrderHeader_SalesPerson_SalesPersonID ( SalesPersonID ) ref SalesPerson (BusinessEntityID) Foreign key constraint referencing SalesPerson.SalesPersonID.
FK_SalesOrderHeader_SalesTerritory_TerritoryID ( TerritoryID ) ref SalesTerritory (TerritoryID) Foreign key constraint referencing SalesTerritory.TerritoryID.
FK_SalesOrderHeader_ShipMethod_ShipMethodID ( ShipMethodID ) ref ShipMethod (ShipMethodID) Foreign key constraint referencing ShipMethod.ShipMethodID.
Constraints
  CK_SalesOrderHeader_DueDate [DueDate]>=[OrderDate]
  CK_SalesOrderHeader_ShipDate [ShipDate]>=[OrderDate] OR [ShipDate] IS NULL
  CK_SalesOrderHeader_DueDate [DueDate]>=[OrderDate]
  CK_SalesOrderHeader_ShipDate [ShipDate]>=[OrderDate] OR [ShipDate] IS NULL
  CK_SalesOrderHeader_Status [Status]>=(0) AND [Status]<=(8)
  CK_SalesOrderHeader_SubTotal [SubTotal]>=(0.00)
  CK_SalesOrderHeader_TaxAmt [TaxAmt]>=(0.00)
  CK_SalesOrderHeader_Freight [Freight]>=(0.00)
Triggers
  uSalesOrderHeader


Table SalesOrderHeaderSalesReason

Cross-reference table mapping sales orders to sales reason codes.

IdxField NameData TypeDescription
* SalesOrderID int Primary key. Foreign key to SalesOrderHeader.SalesOrderID.
* SalesReasonID int Primary key. Foreign key to SalesReason.SalesReasonID.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_SalesOrderHeaderSalesReason_SalesOrderID_SalesReasonID ON SalesOrderID, SalesReasonID Clustered index created by a primary key constraint.
Foreign Keys
FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID ( SalesOrderID ) ref SalesOrderHeader (SalesOrderID) Foreign key constraint referencing SalesOrderHeader.SalesOrderID.
FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID ( SalesReasonID ) ref SalesReason (SalesReasonID) Foreign key constraint referencing SalesReason.SalesReasonID.


Table SalesPerson

Sales representative current information.

IdxField NameData TypeDescription
* BusinessEntityID int Primary key for SalesPerson records. Foreign key to Employee.BusinessEntityID
TerritoryID int Territory currently assigned to. Foreign key to SalesTerritory.SalesTerritoryID.
  SalesQuota money Projected yearly sales.
* Bonus money DEFAULT 0.00 Bonus due if quota is met.
* CommissionPct smallmoney DEFAULT 0.00 Commision percent received per sale.
* SalesYTD money DEFAULT 0.00 Sales total year to date.
* SalesLastYear money DEFAULT 0.00 Sales total of previous year.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_SalesPerson_BusinessEntityID ON BusinessEntityID Clustered index created by a primary key constraint.
AK_SalesPerson_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.
Foreign Keys
FK_SalesPerson_Employee_BusinessEntityID ( BusinessEntityID ) ref Employee (BusinessEntityID) Foreign key constraint referencing Employee.EmployeeID.
FK_SalesPerson_SalesTerritory_TerritoryID ( TerritoryID ) ref SalesTerritory (TerritoryID) Foreign key constraint referencing SalesTerritory.TerritoryID.
Constraints
  CK_SalesPerson_SalesQuota [SalesQuota]>(0.00)
  CK_SalesPerson_Bonus [Bonus]>=(0.00)
  CK_SalesPerson_CommissionPct [CommissionPct]>=(0.00)
  CK_SalesPerson_SalesYTD [SalesYTD]>=(0.00)
  CK_SalesPerson_SalesLastYear [SalesLastYear]>=(0.00)


Table SalesPersonQuotaHistory

Sales performance tracking.

IdxField NameData TypeDescription
* BusinessEntityID int Sales person identification number. Foreign key to SalesPerson.BusinessEntityID.
* QuotaDate datetime Sales quota date.
* SalesQuota money Sales quota amount.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_SalesPersonQuotaHistory_BusinessEntityID_QuotaDate ON BusinessEntityID, QuotaDate Clustered index created by a primary key constraint.
AK_SalesPersonQuotaHistory_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.
Foreign Keys
FK_SalesPersonQuotaHistory_SalesPerson_BusinessEntityID ( BusinessEntityID ) ref SalesPerson (BusinessEntityID) Foreign key constraint referencing SalesPerson.SalesPersonID.
Constraints
  CK_SalesPersonQuotaHistory_SalesQuota [SalesQuota]>(0.00)


Table SalesReason

Lookup table of customer purchase reasons.

IdxField NameData TypeDescription
* SalesReasonID int AUTOINCREMENT Primary key for SalesReason records.
* Name name Sales reason description.
* ReasonType name Category the sales reason belongs to.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_SalesReason_SalesReasonID ON SalesReasonID Clustered index created by a primary key constraint.


Table SalesTaxRate

Tax rate lookup table.

IdxField NameData TypeDescription
* SalesTaxRateID int AUTOINCREMENT Primary key for SalesTaxRate records.
* StateProvinceID int State, province, or country/region the sales tax applies to.
* TaxType tinyint 1 = Tax applied to retail transactions, 2 = Tax applied to wholesale transactions, 3 = Tax applied to all sales (retail and wholesale) transactions.
* TaxRate smallmoney DEFAULT 0.00 Tax rate amount.
* Name name Tax rate description.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_SalesTaxRate_SalesTaxRateID ON SalesTaxRateID Clustered index created by a primary key constraint.
AK_SalesTaxRate_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.
AK_SalesTaxRate_StateProvinceID_TaxType ON StateProvinceID, TaxType Unique nonclustered index.
Foreign Keys
FK_SalesTaxRate_StateProvince_StateProvinceID ( StateProvinceID ) ref StateProvince (StateProvinceID) Foreign key constraint referencing StateProvince.StateProvinceID.
Constraints
  CK_SalesTaxRate_TaxType [TaxType]>=(1) AND [TaxType]<=(3)


Table SalesTerritory

Sales territory lookup table.

IdxField NameData TypeDescription
* Name name Sales territory description
* CountryRegionCode nvarchar(3) ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode.
* Group nvarchar(50) Geographic area to which the sales territory belong.
* TerritoryID int AUTOINCREMENT Primary key for SalesTerritory records.
* SalesYTD money DEFAULT 0.00 Sales in the territory year to date.
* SalesLastYear money DEFAULT 0.00 Sales in the territory the previous year.
* CostYTD money DEFAULT 0.00 Business costs in the territory year to date.
* CostLastYear money DEFAULT 0.00 Business costs in the territory the previous year.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_SalesTerritory_TerritoryID ON TerritoryID Clustered index created by a primary key constraint.
AK_SalesTerritory_Name ON Name Unique nonclustered index.
AK_SalesTerritory_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.
Foreign Keys
FK_SalesTerritory_CountryRegion_CountryRegionCode ( CountryRegionCode ) ref CountryRegion (CountryRegionCode) Foreign key constraint referencing CountryRegion.CountryRegionCode.
Constraints
  CK_SalesTerritory_SalesYTD [SalesYTD]>=(0.00)
  CK_SalesTerritory_SalesLastYear [SalesLastYear]>=(0.00)
  CK_SalesTerritory_CostYTD [CostYTD]>=(0.00)
  CK_SalesTerritory_CostLastYear [CostLastYear]>=(0.00)


Table SalesTerritoryHistory

Sales representative transfers to other sales territories.

IdxField NameData TypeDescription
* BusinessEntityID int Primary key. The sales rep. Foreign key to SalesPerson.BusinessEntityID.
* StartDate datetime Primary key. Date the sales representive started work in the territory.
* TerritoryID int Primary key. Territory identification number. Foreign key to SalesTerritory.SalesTerritoryID.
  EndDate datetime Date the sales representative left work in the territory.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_SalesTerritoryHistory_BusinessEntityID_StartDate_TerritoryID ON BusinessEntityID, StartDate, TerritoryID Clustered index created by a primary key constraint.
AK_SalesTerritoryHistory_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.
Foreign Keys
FK_SalesTerritoryHistory_SalesPerson_BusinessEntityID ( BusinessEntityID ) ref SalesPerson (BusinessEntityID) Foreign key constraint referencing SalesPerson.SalesPersonID.
FK_SalesTerritoryHistory_SalesTerritory_TerritoryID ( TerritoryID ) ref SalesTerritory (TerritoryID) Foreign key constraint referencing SalesTerritory.TerritoryID.
Constraints
  CK_SalesTerritoryHistory_EndDate [EndDate]>=[StartDate] OR [EndDate] IS NULL
  CK_SalesTerritoryHistory_EndDate [EndDate]>=[StartDate] OR [EndDate] IS NULL


Table ScrapReason

Manufacturing failure reasons lookup table.

IdxField NameData TypeDescription
* ScrapReasonID smallint AUTOINCREMENT Primary key for ScrapReason records.
* Name name Failure description.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ScrapReason_ScrapReasonID ON ScrapReasonID Clustered index created by a primary key constraint.
AK_ScrapReason_Name ON Name Unique nonclustered index.


Table Shift

Work shift lookup table.

IdxField NameData TypeDescription
* ShiftID tinyint AUTOINCREMENT Primary key for Shift records.
* Name name Shift description.
* StartTime time(16) Shift start time.
* EndTime time(16) Shift end time.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_Shift_ShiftID ON ShiftID Clustered index created by a primary key constraint.
AK_Shift_Name ON Name Unique nonclustered index.
AK_Shift_StartTime_EndTime ON StartTime, EndTime Unique nonclustered index.


Table ShipMethod

Shipping company lookup table.

IdxField NameData TypeDescription
* ShipMethodID int AUTOINCREMENT Primary key for ShipMethod records.
* Name name Shipping company name.
* ShipBase money DEFAULT 0.00 Minimum shipping charge.
* ShipRate money DEFAULT 0.00 Shipping charge per pound.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ShipMethod_ShipMethodID ON ShipMethodID Clustered index created by a primary key constraint.
AK_ShipMethod_Name ON Name Unique nonclustered index.
AK_ShipMethod_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.
Constraints
  CK_ShipMethod_ShipBase [ShipBase]>(0.00)
  CK_ShipMethod_ShipRate [ShipRate]>(0.00)


Table ShoppingCartItem

Contains online customer orders until the order is submitted or cancelled.

IdxField NameData TypeDescription
* ShoppingCartItemID int AUTOINCREMENT Primary key for ShoppingCartItem records.
* ShoppingCartID nvarchar(50) Shopping cart identification number.
* Quantity int DEFAULT 1 Product quantity ordered.
* ProductID int Product ordered. Foreign key to Product.ProductID.
* DateCreated datetime DEFAULT getdate() Date the time the record was created.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ShoppingCartItem_ShoppingCartItemID ON ShoppingCartItemID Clustered index created by a primary key constraint.
IX_ShoppingCartItem_ShoppingCartID_ProductID ON ShoppingCartID, ProductID Nonclustered index.
Foreign Keys
FK_ShoppingCartItem_Product_ProductID ( ProductID ) ref Product (ProductID) Foreign key constraint referencing Product.ProductID.
Constraints
  CK_ShoppingCartItem_Quantity [Quantity]>=(1)


Table SpecialOffer

Sale discounts lookup table.

IdxField NameData TypeDescription
* SpecialOfferID int AUTOINCREMENT Primary key for SpecialOffer records.
* Description nvarchar(255) Discount description.
* DiscountPct smallmoney DEFAULT 0.00 Discount precentage.
* Type nvarchar(50) Discount type category.
* Category nvarchar(50) Group the discount applies to such as Reseller or Customer.
* StartDate datetime Discount start date.
* EndDate datetime Discount end date.
* MinQty int DEFAULT 0 Minimum discount percent allowed.
  MaxQty int Maximum discount percent allowed.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_SpecialOffer_SpecialOfferID ON SpecialOfferID Clustered index created by a primary key constraint.
AK_SpecialOffer_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.
Constraints
  CK_SpecialOffer_DiscountPct [DiscountPct]>=(0.00)
  CK_SpecialOffer_EndDate [EndDate]>=[StartDate]
  CK_SpecialOffer_EndDate [EndDate]>=[StartDate]
  CK_SpecialOffer_MinQty [MinQty]>=(0)
  CK_SpecialOffer_MaxQty [MaxQty]>=(0)


Table SpecialOfferProduct

Cross-reference table mapping products to special offer discounts.

IdxField NameData TypeDescription
* SpecialOfferID int Primary key for SpecialOfferProduct records.
* ProductID int Product identification number. Foreign key to Product.ProductID.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_SpecialOfferProduct_SpecialOfferID_ProductID ON SpecialOfferID, ProductID Clustered index created by a primary key constraint.
AK_SpecialOfferProduct_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.
IX_SpecialOfferProduct_ProductID ON ProductID Nonclustered index.
Foreign Keys
FK_SpecialOfferProduct_Product_ProductID ( ProductID ) ref Product (ProductID) Foreign key constraint referencing Product.ProductID.
FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID ( SpecialOfferID ) ref SpecialOffer (SpecialOfferID) Foreign key constraint referencing SpecialOffer.SpecialOfferID.


Table StateProvince

State and province lookup table.

IdxField NameData TypeDescription
* StateProvinceID int AUTOINCREMENT Primary key for StateProvince records.
* StateProvinceCode nchar(3) ISO standard state or province code.
* CountryRegionCode nvarchar(3) ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode.
* IsOnlyStateProvinceFlag flag DEFAULT 1 0 = StateProvinceCode exists. 1 = StateProvinceCode unavailable, using CountryRegionCode.
* Name name State or province description.
* TerritoryID int ID of the territory in which the state or province is located. Foreign key to SalesTerritory.SalesTerritoryID.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_StateProvince_StateProvinceID ON StateProvinceID Clustered index created by a primary key constraint.
AK_StateProvince_Name ON Name Unique nonclustered index.
AK_StateProvince_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.
AK_StateProvince_StateProvinceCode_CountryRegionCode ON StateProvinceCode, CountryRegionCode Unique nonclustered index.
Foreign Keys
FK_StateProvince_CountryRegion_CountryRegionCode ( CountryRegionCode ) ref CountryRegion (CountryRegionCode) Foreign key constraint referencing CountryRegion.CountryRegionCode.
FK_StateProvince_SalesTerritory_TerritoryID ( TerritoryID ) ref SalesTerritory (TerritoryID) Foreign key constraint referencing SalesTerritory.TerritoryID.


Table Store

Customers (resellers) of Adventure Works products.

IdxField NameData TypeDescription
* BusinessEntityID int Primary key. Foreign key to Customer.BusinessEntityID.
* Name name Name of the store.
SalesPersonID int ID of the sales person assigned to the customer. Foreign key to SalesPerson.BusinessEntityID.
  Demographics xml Demographic informationg about the store such as the number of employees, annual sales and store type.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_Store_BusinessEntityID ON BusinessEntityID Clustered index created by a primary key constraint.
AK_Store_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.
IX_Store_SalesPersonID ON SalesPersonID Nonclustered index.
Foreign Keys
FK_Store_BusinessEntity_BusinessEntityID ( BusinessEntityID ) ref BusinessEntity (BusinessEntityID) Foreign key constraint referencing BusinessEntity.BusinessEntityID
FK_Store_SalesPerson_SalesPersonID ( SalesPersonID ) ref SalesPerson (BusinessEntityID) Foreign key constraint referencing SalesPerson.SalesPersonID


Table TransactionHistory

Record of each purchase order, sales order, or work order transaction year to date.

IdxField NameData TypeDescription
* TransactionID int AUTOINCREMENT Primary key for TransactionHistory records.
* ProductID int Product identification number. Foreign key to Product.ProductID.
* ReferenceOrderID int Purchase order, sales order, or work order identification number.
* ReferenceOrderLineID int DEFAULT 0 Line number associated with the purchase order, sales order, or work order.
* TransactionDate datetime DEFAULT getdate() Date and time of the transaction.
* TransactionType nchar(1) W = WorkOrder, S = SalesOrder, P = PurchaseOrder
* Quantity int Product quantity.
* ActualCost money Product cost.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_TransactionHistory_TransactionID ON TransactionID Clustered index created by a primary key constraint.
IX_TransactionHistory_ProductID ON ProductID Nonclustered index.
IX_TransactionHistory_ReferenceOrderID_ReferenceOrderLineID ON ReferenceOrderID, ReferenceOrderLineID Nonclustered index.
Foreign Keys
FK_TransactionHistory_Product_ProductID ( ProductID ) ref Product (ProductID) Foreign key constraint referencing Product.ProductID.
Constraints
  CK_TransactionHistory_TransactionType upper([TransactionType])='P' OR upper([TransactionType])='S' OR upper([TransactionType])='W'


Table TransactionHistoryArchive

Transactions for previous years.

IdxField NameData TypeDescription
* TransactionID int Primary key for TransactionHistoryArchive records.
* ProductID int Product identification number. Foreign key to Product.ProductID.
* ReferenceOrderID int Purchase order, sales order, or work order identification number.
* ReferenceOrderLineID int DEFAULT 0 Line number associated with the purchase order, sales order, or work order.
* TransactionDate datetime DEFAULT getdate() Date and time of the transaction.
* TransactionType nchar(1) W = Work Order, S = Sales Order, P = Purchase Order
* Quantity int Product quantity.
* ActualCost money Product cost.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_TransactionHistoryArchive_TransactionID ON TransactionID Clustered index created by a primary key constraint.
IX_TransactionHistoryArchive_ProductID ON ProductID Nonclustered index.
IX_TransactionHistoryArchive_ReferenceOrderID_ReferenceOrderLineID ON ReferenceOrderID, ReferenceOrderLineID Nonclustered index.
Constraints
  CK_TransactionHistoryArchive_TransactionType upper([TransactionType])='P' OR upper([TransactionType])='S' OR upper([TransactionType])='W'


Table UnitMeasure

Unit of measure lookup table.

IdxField NameData TypeDescription
* UnitMeasureCode nchar(3) Primary key.
* Name name Unit of measure description.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_UnitMeasure_UnitMeasureCode ON UnitMeasureCode Clustered index created by a primary key constraint.
AK_UnitMeasure_Name ON Name Unique nonclustered index.


Table Vendor

Companies from whom Adventure Works Cycles purchases parts or other goods.

IdxField NameData TypeDescription
* BusinessEntityID int Primary key for Vendor records. Foreign key to BusinessEntity.BusinessEntityID
* AccountNumber accountnumber Vendor account (identification) number.
* Name name Company name.
* CreditRating tinyint 1 = Superior, 2 = Excellent, 3 = Above average, 4 = Average, 5 = Below average
* PreferredVendorStatus flag DEFAULT 1 0 = Do not use if another vendor is available. 1 = Preferred over other vendors supplying the same product.
* ActiveFlag flag DEFAULT 1 0 = Vendor no longer used. 1 = Vendor is actively used.
  PurchasingWebServiceURL nvarchar(1024) Vendor URL.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_Vendor_BusinessEntityID ON BusinessEntityID Clustered index created by a primary key constraint.
AK_Vendor_AccountNumber ON AccountNumber Unique nonclustered index.
Foreign Keys
FK_Vendor_BusinessEntity_BusinessEntityID ( BusinessEntityID ) ref BusinessEntity (BusinessEntityID) Foreign key constraint referencing BusinessEntity.BusinessEntityID
Constraints
  CK_Vendor_CreditRating [CreditRating]>=(1) AND [CreditRating]<=(5)
Triggers
  dVendor


Table WorkOrder

Manufacturing work orders.

IdxField NameData TypeDescription
* WorkOrderID int AUTOINCREMENT Primary key for WorkOrder records.
* ProductID int Product identification number. Foreign key to Product.ProductID.
* OrderQty int Product quantity to build.
* StockedQty int Quantity built and put in inventory.
* ScrappedQty smallint Quantity that failed inspection.
* StartDate datetime Work order start date.
  EndDate datetime Work order end date.
* DueDate datetime Work order due date.
ScrapReasonID smallint Reason for inspection failure.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_WorkOrder_WorkOrderID ON WorkOrderID Clustered index created by a primary key constraint.
IX_WorkOrder_ProductID ON ProductID Nonclustered index.
IX_WorkOrder_ScrapReasonID ON ScrapReasonID Nonclustered index.
Foreign Keys
FK_WorkOrder_Product_ProductID ( ProductID ) ref Product (ProductID) Foreign key constraint referencing Product.ProductID.
FK_WorkOrder_ScrapReason_ScrapReasonID ( ScrapReasonID ) ref ScrapReason (ScrapReasonID) Foreign key constraint referencing ScrapReason.ScrapReasonID.
Constraints
  CK_WorkOrder_OrderQty [OrderQty]>(0)
  CK_WorkOrder_ScrappedQty [ScrappedQty]>=(0)
  CK_WorkOrder_EndDate [EndDate]>=[StartDate] OR [EndDate] IS NULL
  CK_WorkOrder_EndDate [EndDate]>=[StartDate] OR [EndDate] IS NULL
Triggers
  iWorkOrder
  uWorkOrder


Table WorkOrderRouting

Work order details.

IdxField NameData TypeDescription
* WorkOrderID int Primary key. Foreign key to WorkOrder.WorkOrderID.
* ProductID int Primary key. Foreign key to Product.ProductID.
* OperationSequence smallint Primary key. Indicates the manufacturing process sequence.
* LocationID smallint Manufacturing location where the part is processed. Foreign key to Location.LocationID.
* ScheduledStartDate datetime Planned manufacturing start date.
* ScheduledEndDate datetime Planned manufacturing end date.
  ActualStartDate datetime Actual start date.
  ActualEndDate datetime Actual end date.
  ActualResourceHrs decimal(9,4) Number of manufacturing hours used.
* PlannedCost money Estimated manufacturing cost.
  ActualCost money Actual manufacturing cost.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequence ON WorkOrderID, ProductID, OperationSequence Clustered index created by a primary key constraint.
IX_WorkOrderRouting_ProductID ON ProductID Nonclustered index.
Foreign Keys
FK_WorkOrderRouting_Location_LocationID ( LocationID ) ref Location (LocationID) Foreign key constraint referencing Location.LocationID.
FK_WorkOrderRouting_WorkOrder_WorkOrderID ( WorkOrderID ) ref WorkOrder (WorkOrderID) Foreign key constraint referencing WorkOrder.WorkOrderID.
Constraints
  CK_WorkOrderRouting_ScheduledEndDate [ScheduledEndDate]>=[ScheduledStartDate]
  CK_WorkOrderRouting_ScheduledEndDate [ScheduledEndDate]>=[ScheduledStartDate]
  CK_WorkOrderRouting_ActualEndDate [ActualEndDate]>=[ActualStartDate] OR [ActualEndDate] IS NULL OR [ActualStartDate] IS NULL
  CK_WorkOrderRouting_ActualEndDate [ActualEndDate]>=[ActualStartDate] OR [ActualEndDate] IS NULL OR [ActualStartDate] IS NULL
  CK_WorkOrderRouting_ActualResourceHrs [ActualResourceHrs]>=(0.0000)
  CK_WorkOrderRouting_PlannedCost [PlannedCost]>(0.00)
  CK_WorkOrderRouting_ActualCost [ActualCost]>(0.00)