Professional Documents
Culture Documents
Adventureworks2014: Generated Using SQL Data Dictionary Demo Version
Adventureworks2014: Generated Using SQL Data Dictionary Demo Version
AdventureWorks2014
dbo.DatabaseLog (1,597 rows) ................................................................................ 1
Audit table tracking all DDL changes made to the AdventureWorks database. Data is captured by the
database trigger ddlDatabaseTriggerLog.
dbo.ErrorLog (0 rows) ............................................................................................. 1
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.
HumanResources.Department (16 rows) ................................................................. 2
Lookup table containing the departments within the Adventure Works Cycles company.
HumanResources.Employee (290 rows) .................................................................. 3
Employee information such as salary, department, and title.
HumanResources.EmployeeDepartmentHistory (296 rows) ..................................... 5
Employee department transfers.
HumanResources.EmployeePayHistory (316 rows) ..................................................5
Employee pay history.
HumanResources.JobCandidate (13 rows) .............................................................. 6
Résumés submitted to Human Resources by job applicants.
HumanResources.Shift (3 rows) .............................................................................. 7
Work shift lookup table.
Person.Address (19,614 rows) ................................................................................. 7
Street address information for customers, employees, and vendors.
Person.AddressType (6 rows) ................................................................................. 9
Types of addresses stored in the Address table.
Person.BusinessEntity (20,777 rows) ...................................................................... 9
Source of the ID that connects vendors, customers, and employees with address and contact information.
Person.BusinessEntityAddress (19,614 rows) ........................................................ 10
Cross-reference table mapping customers, vendors, and employees to their addresses.
Person.BusinessEntityContact (909 rows) ............................................................. 11
Cross-reference table mapping stores, vendors, and employees to people
Person.ContactType (20 rows) .............................................................................. 12
Lookup table containing the types of business entity contacts.
Person.CountryRegion (238 rows) ......................................................................... 12
Lookup table containing the ISO standard codes for countries and regions.
Person.EmailAddress (19,972 rows) ...................................................................... 13
Where to send a person email.
I
Person.Password (19,972 rows) ............................................................................ 14
One way hashed authentication information
Person.Person (19,972 rows) ................................................................................. 14
Human beings involved with AdventureWorks: employees, customer contacts, and vendor contacts.
Person.PersonPhone (19,972 rows) ....................................................................... 17
Telephone number and type of a person.
Person.PhoneNumberType (3 rows) ...................................................................... 17
Type of phone number of a person.
Person.StateProvince (181 rows) .......................................................................... 18
State and province lookup table.
Production.BillOfMaterials (2,679 rows) ................................................................ 19
Items required to make bicycles and bicycle subassemblies. It identifies the heirarchical relationship
between a parent product and its components.
Production.Culture (8 rows) .................................................................................. 20
Lookup table containing the languages in which some AdventureWorks data is stored.
Production.Document (13 rows) ............................................................................ 21
Product maintenance documents.
Production.Illustration (5 rows) ............................................................................ 22
Bicycle assembly diagrams.
Production.Location (14 rows) .............................................................................. 22
Product inventory and manufacturing locations.
Production.Product (504 rows) .............................................................................. 23
Products sold or used in the manfacturing of sold products.
Production.ProductCategory (4 rows) ................................................................... 25
High-level product categorization.
Production.ProductCostHistory (395 rows) ............................................................ 25
Changes in the cost of a product over time.
Production.ProductDescription (762 rows) ............................................................ 26
Product descriptions in several languages.
Production.ProductDocument (32 rows) ................................................................ 27
Cross-reference table mapping products to related product documents.
Production.ProductInventory (1,069 rows) ............................................................27
Product inventory information.
Production.ProductListPriceHistory (395 rows) ..................................................... 28
Changes in the list price of a product over time.
Production.ProductModel (128 rows) .....................................................................28
Product model classification.
II
Production.ProductModelIllustration (7 rows) .......................................................29
Cross-reference table mapping product models and illustrations.
Production.ProductModelProductDescriptionCulture (762 rows) ............................30
Cross-reference table mapping product descriptions and the language the description is written in.
Production.ProductPhoto (101 rows) ..................................................................... 30
Product images.
Production.ProductProductPhoto (504 rows) ......................................................... 31
Cross-reference table mapping products and product photos.
Production.ProductReview (4 rows) ...................................................................... 31
Customer reviews of products they have purchased.
Production.ProductSubcategory (37 rows) ............................................................ 32
Product subcategories. See ProductCategory table.
Production.ScrapReason (16 rows) ....................................................................... 33
Manufacturing failure reasons lookup table.
Production.TransactionHistory (113,443 rows) ...................................................... 33
Record of each purchase order, sales order, or work order transaction year to date.
Production.TransactionHistoryArchive (89,253 rows) ............................................ 34
Transactions for previous years.
Production.UnitMeasure (38 rows) ........................................................................ 35
Unit of measure lookup table.
Production.WorkOrder (72,591 rows) .................................................................... 35
Manufacturing work orders.
Production.WorkOrderRouting (67,131 rows) ........................................................ 36
Work order details.
Purchasing.ProductVendor (460 rows) .................................................................. 37
Cross-reference table mapping vendors with the products they supply.
Purchasing.PurchaseOrderDetail (8,845 rows) ...................................................... 38
Individual products associated with a specific purchase order. See PurchaseOrderHeader.
Purchasing.PurchaseOrderHeader (4,012 rows) .................................................... 39
General purchase order information. See PurchaseOrderDetail.
Purchasing.ShipMethod (5 rows) ...........................................................................40
Shipping company lookup table.
Purchasing.Vendor (104 rows) .............................................................................. 41
Companies from whom Adventure Works Cycles purchases parts or other goods.
Sales.CountryRegionCurrency (109 rows) ..............................................................42
Cross-reference table mapping ISO currency codes to a country or region.
Sales.CreditCard (19,118 rows) ............................................................................. 42
III
Customer credit card information.
Sales.Currency (105 rows) .................................................................................... 43
Lookup table containing standard ISO currencies.
Sales.CurrencyRate (13,532 rows) ......................................................................... 44
Currency exchange rates.
Sales.Customer (19,820 rows) ............................................................................... 44
Current customer information. Also see the Person and Store tables.
Sales.PersonCreditCard (19,118 rows) ................................................................... 45
Cross-reference table mapping people to their credit card information in the CreditCard table.
Sales.SalesOrderDetail (121,317 rows) .................................................................. 46
Individual products associated with a specific sales order. See SalesOrderHeader.
Sales.SalesOrderHeader (31,465 rows) .................................................................. 47
General sales order information.
Sales.SalesOrderHeaderSalesReason (27,647 rows) .............................................. 49
Cross-reference table mapping sales orders to sales reason codes.
Sales.SalesPerson (17 rows) ................................................................................. 49
Sales representative current information.
Sales.SalesPersonQuotaHistory (163 rows) ........................................................... 50
Sales performance tracking.
Sales.SalesReason (10 rows) ................................................................................. 51
Lookup table of customer purchase reasons.
Sales.SalesTaxRate (29 rows) ............................................................................... 51
Tax rate lookup table.
Sales.SalesTerritory (10 rows) .............................................................................. 52
Sales territory lookup table.
Sales.SalesTerritoryHistory (17 rows) ................................................................... 53
Sales representative transfers to other sales territories.
Sales.ShoppingCartItem (3 rows) ......................................................................... 54
Contains online customer orders until the order is submitted or cancelled.
Sales.SpecialOffer (16 rows) ................................................................................. 54
Sale discounts lookup table.
Sales.SpecialOfferProduct (538 rows) ................................................................... 55
Cross-reference table mapping products to special offer discounts.
Sales.Store (701 rows) .......................................................................................... 56
Customers (resellers) of Adventure Works products.
Views:
IV
HumanResources.vEmployee ............................................................................... 58
Employee names and addresses.
HumanResources.vEmployeeDepartment ............................................................. 58
Returns employee name, title, and current department.
HumanResources.vEmployeeDepartmentHistory ..................................................59
Returns employee name and current and previous departments.
HumanResources.vJobCandidate ......................................................................... 59
Job candidate names and resumes.
HumanResources.vJobCandidateEducation .......................................................... 60
Displays the content from each education related element in the xml column Resume in the
HumanResources.JobCandidate table. The content has been localized into French, Simplified Chinese and Thai.
Some data may not display correctly unless supplemental language support is installed.
HumanResources.vJobCandidateEmployment ...................................................... 60
Displays the content from each employement history related element in the xml column Resume in the
HumanResources.JobCandidate table. The content has been localized into French, Simplified Chinese and Thai.
Some data may not display correctly unless supplemental language support is installed.
Person.vAdditionalContactInfo ............................................................................ 60
Displays the contact name and content from each element in the xml column AdditionalContactInfo for
that person.
Person.vStateProvinceCountryRegion .................................................................. 61
Joins StateProvince table with CountryRegion table.
Production.vProductAndDescription .................................................................... 61
Product names and descriptions. Product descriptions are provided in multiple languages.
Production.vProductModelCatalogDescription ......................................................62
Displays the content from each element in the xml column CatalogDescription for each product in the
Production.ProductModel table that has catalog data.
Production.vProductModelInstructions ................................................................ 62
Displays the content from each element in the xml column Instructions for each product in the
Production.ProductModel table that has manufacturing instructions.
Purchasing.vVendorWithAddresses ......................................................................63
Vendor (company) names and addresses .
Purchasing.vVendorWithContacts ........................................................................ 63
Vendor (company) names and the names of vendor employees to contact.
Sales.vIndividualCustomer .................................................................................. 64
Individual customers (names and addresses) that purchase Adventure Works Cycles products online.
Sales.vPersonDemographics ................................................................................ 64
Displays the content from each element in the xml column Demographics for each customer in the
Person.Person table.
Sales.vSalesPerson .............................................................................................. 65
Sales representiatives (names and addresses) and their sales-related information.
Sales.vSalesPersonSalesByFiscalYears ................................................................ 66
V
Uses PIVOT to return aggregated sales information for each sales representative.
Sales.vStoreWithAddresses ................................................................................. 66
Stores (including store addresses) that sell Adventure Works Cycles products to consumers.
Sales.vStoreWithContacts .................................................................................... 67
Stores (including store contacts) that sell Adventure Works Cycles products to consumers.
Sales.vStoreWithDemographics ........................................................................... 67
Stores (including demographics) that sell Adventure Works Cycles products to consumers.
Procedures:
dbo.uspGetBillOfMaterials ....................................................................................68
Stored procedure using a recursive query to return a multi-level bill of material for the specified
ProductID.
dbo.uspGetEmployeeManagers ............................................................................ 68
Stored procedure using a recursive query to return the direct and indirect managers of the specified
employee.
dbo.uspGetManagerEmployees ............................................................................ 69
Stored procedure using a recursive query to return the direct and indirect employees of the specified
manager.
dbo.uspGetWhereUsedProductID ......................................................................... 69
Stored procedure using a recursive query to return all components or assemblies that directly or indirectly
use the specified ProductID.
dbo.uspLogError .................................................................................................. 70
Logs error information in the ErrorLog table about the error that caused execution to jump to the CATCH
block of a TRY...CATCH construct. Should be executed from within the scope of a CATCH block otherwise it will
return without inserting error information.
dbo.uspPrintError ................................................................................................ 70
Prints error information about the error that caused execution to jump to the CATCH block of a
TRY...CATCH construct. Should be executed from within the scope of a CATCH block otherwise it will return without
printing any error information.
dbo.uspSearchCandidateResumes ........................................................................71
HumanResources.uspUpdateEmployeeHireInfo ................................................... 71
Updates the Employee table and inserts a new row in the EmployeePayHistory table with the values
specified in the input parameters.
HumanResources.uspUpdateEmployeeLogin ........................................................ 71
Updates the Employee table with the values specified in the input parameters for the given
BusinessEntityID.
HumanResources.uspUpdateEmployeePersonalInfo ............................................ 72
Updates the Employee table with the values specified in the input parameters for the given EmployeeID.
Functions:
dbo.ufnGetAccountingEndDate ............................................................................ 73
Scalar function used in the uSalesOrderHeader trigger to set the starting account date.
VI
dbo.ufnGetAccountingStartDate ...........................................................................73
Scalar function used in the uSalesOrderHeader trigger to set the ending account date.
dbo.ufnGetContactInformation ............................................................................ 73
Table value function returning the first name, last name, job title and contact type for a given contact.
dbo.ufnGetDocumentStatusText .......................................................................... 74
Scalar function returning the text representation of the Status column in the Document table.
dbo.ufnGetProductDealerPrice ............................................................................. 74
Scalar function returning the dealer price for a given product on a particular order date.
dbo.ufnGetProductListPrice ................................................................................. 74
Scalar function returning the list price for a given product on a particular order date.
dbo.ufnGetProductStandardCost .......................................................................... 75
Scalar function returning the standard cost for a given product on a particular order date.
dbo.ufnGetPurchaseOrderStatusText ................................................................... 75
Scalar function returning the text representation of the Status column in the PurchaseOrderHeader table.
dbo.ufnGetSalesOrderStatusText ......................................................................... 75
Scalar function returning the text representation of the Status column in the SalesOrderHeader table.
dbo.ufnGetStock .................................................................................................. 75
Scalar function returning the quantity of inventory in LocationID 6 (Miscellaneous Storage)for a specified
ProductID.
dbo.ufnLeadingZeros ........................................................................................... 76
Scalar function used by the Sales.Customer table to help set the account number.
VII
Tables
Tables:
dbo.AWBuildVersion
Table dbo.AWBuildVersion (1 row)
Indexes:
SystemInformationID
dbo.DatabaseLog
Table dbo.DatabaseLog (1,597 rows)
Audit table tracking all DDL changes made to the AdventureWorks database. Data is captured by the database trigger
ddlDatabaseTriggerLog.
Indexes:
DatabaseLogID
dbo.ErrorLog
Table dbo.ErrorLog (0 rows)
Audit table tracking errors in the the AdventureWorks database that are caught by the CATCH block of a TRY...CATCH
Page 1 of 76
construct. Data is inserted by stored procedure dbo.uspLogError when it is executed from inside the CATCH block of a TRY...CATCH
construct.
Indexes:
ErrorLogID
Used by:
Procedure dbo.uspLogError
HumanResources.Department
Table HumanResources.Department (16 rows)
Lookup table containing the departments within the Adventure Works Cycles company.
Indexes:
DepartmentID
AK_Department_Name (Unique)
Page 2 of 76
Name
Referenced by:
HumanResources.EmployeeDepartmentHistory (DepartmentID)
Used by:
View HumanResources.vEmployeeDepartment
View HumanResources.vEmployeeDepartmentHistory
HumanResources.Employee
Table HumanResources.Employee (290 rows)
Indexes:
BusinessEntityID
Page 3 of 76
AK_Employee_LoginID (Unique)
LoginID
AK_Employee_NationalIDNumber (Unique)
NationalIDNumber
AK_Employee_rowguid (Unique)
rowguid
IX_Employee_OrganizationLevel_OrganizationNode
OrganizationLevel
OrganizationNode
IX_Employee_OrganizationNode
OrganizationNode
References:
Person.Person (BusinessEntityID)
Referenced by:
HumanResources.EmployeeDepartmentHistory (BusinessEntityID)
HumanResources.EmployeePayHistory (BusinessEntityID)
HumanResources.JobCandidate (BusinessEntityID)
Sales.SalesPerson (BusinessEntityID)
Triggers:
Used by:
Function dbo.ufnGetContactInformation
Procedure dbo.uspGetEmployeeManagers
Procedure dbo.uspGetManagerEmployees
Procedure HumanResources.uspUpdateEmployeeHireInfo
Procedure HumanResources.uspUpdateEmployeeLogin
Procedure HumanResources.uspUpdateEmployeePersonalInfo
View HumanResources.vEmployee
Page 4 of 76
View HumanResources.vEmployeeDepartment
View HumanResources.vEmployeeDepartmentHistory
View Sales.vSalesPerson
View Sales.vSalesPersonSalesByFiscalYears
HumanResources.EmployeeDepartmentHistory
Table HumanResources.EmployeeDepartmentHistory (296 rows)
Indexes:
BusinessEntityID
StartDate
DepartmentID
ShiftID
IX_EmployeeDepartmentHistory_DepartmentID
Nonclustered index.
DepartmentID
IX_EmployeeDepartmentHistory_ShiftID
Nonclustered index.
ShiftID
References:
HumanResources.Department (DepartmentID)
HumanResources.Employee (BusinessEntityID)
HumanResources.Shift (ShiftID)
Used by:
View HumanResources.vEmployeeDepartment
View HumanResources.vEmployeeDepartmentHistory
HumanResources.EmployeePayHistory
Table HumanResources.EmployeePayHistory (316 rows)
Page 5 of 76
Employee pay history.
Indexes:
BusinessEntityID
RateChangeDate
References:
HumanResources.Employee (BusinessEntityID)
Used by:
Procedure HumanResources.uspUpdateEmployeeHireInfo
HumanResources.JobCandidate
Table HumanResources.JobCandidate (13 rows)
Indexes:
JobCandidateID
IX_JobCandidate_BusinessEntityID
Nonclustered index.
BusinessEntityID
References:
Page 6 of 76
HumanResources.Employee (BusinessEntityID)
Used by:
Procedure dbo.uspSearchCandidateResumes
View HumanResources.vJobCandidate
View HumanResources.vJobCandidateEducation
View HumanResources.vJobCandidateEmployment
HumanResources.Shift
Table HumanResources.Shift (3 rows)
Indexes:
ShiftID
AK_Shift_Name (Unique)
Name
AK_Shift_StartTime_EndTime (Unique)
StartTime
EndTime
Referenced by:
HumanResources.EmployeeDepartmentHistory (ShiftID)
Used by:
View HumanResources.vEmployeeDepartmentHistory
Person.Address
Table Person.Address (19,614 rows)
Page 7 of 76
UK AddressLine1 nvarchar(60)
First street address line.
UK AddressLine2 nvarchar(60) X
Second street address line.
UK City nvarchar(30)
Name of the city.
UK, FK StateProvinceID int
Unique identification number for the state or province. Foreign key to StateProvince
table.
UK PostalCode nvarchar(15)
Postal code for the street address.
SpatialLocation geography X
Latitude and longitude of this address.
UK rowguid uniqueidentifier newid()
ROWGUIDCOL number uniquely identifying the record. Used to support a merge
replication sample.
ModifiedDate datetime getdate()
Date and time the record was last updated.
Indexes:
AddressID
AK_Address_rowguid (Unique)
rowguid
IX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCode (Unique)
Nonclustered index.
AddressLine1
AddressLine2
City
StateProvinceID
PostalCode
IX_Address_StateProvinceID
Nonclustered index.
StateProvinceID
References:
Person.StateProvince (StateProvinceID)
Referenced by:
Person.BusinessEntityAddress (AddressID)
Used by:
View HumanResources.vEmployee
View Purchasing.vVendorWithAddresses
Page 8 of 76
View Sales.vIndividualCustomer
View Sales.vSalesPerson
View Sales.vStoreWithAddresses
Person.AddressType
Table Person.AddressType (6 rows)
Indexes:
AddressTypeID
AK_AddressType_Name (Unique)
Name
AK_AddressType_rowguid (Unique)
rowguid
Referenced by:
Person.BusinessEntityAddress (AddressTypeID)
Used by:
View Purchasing.vVendorWithAddresses
View Sales.vIndividualCustomer
View Sales.vStoreWithAddresses
Person.BusinessEntity
Table Person.BusinessEntity (20,777 rows)
Source of the ID that connects vendors, customers, and employees with address and contact information.
Page 9 of 76
Date and time the record was last updated.
Indexes:
BusinessEntityID
AK_BusinessEntity_rowguid (Unique)
rowguid
Referenced by:
Person.BusinessEntityAddress (BusinessEntityID)
Person.BusinessEntityContact (BusinessEntityID)
Person.Person (BusinessEntityID)
Purchasing.Vendor (BusinessEntityID)
Sales.Store (BusinessEntityID)
Person.BusinessEntityAddress
Table Person.BusinessEntityAddress (19,614 rows)
Indexes:
BusinessEntityID
AddressID
AddressTypeID
AK_BusinessEntityAddress_rowguid (Unique)
rowguid
IX_BusinessEntityAddress_AddressID
Nonclustered index.
Page 10 of 76
AddressID
IX_BusinessEntityAddress_AddressTypeID
Nonclustered index.
AddressTypeID
References:
Person.Address (AddressID)
Person.AddressType (AddressTypeID)
Person.BusinessEntity (BusinessEntityID)
Used by:
View HumanResources.vEmployee
View Purchasing.vVendorWithAddresses
View Sales.vIndividualCustomer
View Sales.vSalesPerson
View Sales.vStoreWithAddresses
Person.BusinessEntityContact
Table Person.BusinessEntityContact (909 rows)
Indexes:
BusinessEntityID
PersonID
ContactTypeID
AK_BusinessEntityContact_rowguid (Unique)
rowguid
IX_BusinessEntityContact_ContactTypeID
Nonclustered index.
Page 11 of 76
ContactTypeID
IX_BusinessEntityContact_PersonID
Nonclustered index.
PersonID
References:
Person.BusinessEntity (BusinessEntityID)
Person.ContactType (ContactTypeID)
Used by:
Function dbo.ufnGetContactInformation
View Purchasing.vVendorWithContacts
View Sales.vStoreWithContacts
Person.ContactType
Table Person.ContactType (20 rows)
Indexes:
ContactTypeID
AK_ContactType_Name (Unique)
Name
Referenced by:
Person.BusinessEntityContact (ContactTypeID)
Used by:
Function dbo.ufnGetContactInformation
View Purchasing.vVendorWithContacts
View Sales.vStoreWithContacts
Person.CountryRegion
Table Person.CountryRegion (238 rows)
Lookup table containing the ISO standard codes for countries and regions.
Page 12 of 76
Column Data Type Identity Nullable Default
PK CountryRegionCode nvarchar(3)
ISO standard code for countries and regions.
UK Name Name(nvarchar(50))
Country or region name.
ModifiedDate datetime getdate()
Date and time the record was last updated.
Indexes:
CountryRegionCode
AK_CountryRegion_Name (Unique)
Name
Referenced by:
Person.StateProvince (CountryRegionCode)
Sales.CountryRegionCurrency (CountryRegionCode)
Sales.SalesTerritory (CountryRegionCode)
Used by:
View HumanResources.vEmployee
View Person.vStateProvinceCountryRegion
View Purchasing.vVendorWithAddresses
View Sales.vIndividualCustomer
View Sales.vSalesPerson
View Sales.vStoreWithAddresses
Person.EmailAddress
Table Person.EmailAddress (19,972 rows)
Page 13 of 76
Indexes:
BusinessEntityID
EmailAddressID
IX_EmailAddress_EmailAddress
Nonclustered index.
EmailAddress
References:
Person.Person (BusinessEntityID)
Used by:
View HumanResources.vEmployee
View Purchasing.vVendorWithContacts
View Sales.vIndividualCustomer
View Sales.vSalesPerson
View Sales.vStoreWithContacts
Person.Password
Table Person.Password (19,972 rows)
Indexes:
BusinessEntityID
References:
Person.Person (BusinessEntityID)
Person.Person
Table Person.Person (19,972 rows)
Human beings involved with AdventureWorks: employees, customer contacts, and vendor contacts.
Page 14 of 76
PK, FK 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(bit) 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) X
A courtesy title. For example, Mr. or Ms.
FirstName Name(nvarchar(50))
First name of the person.
MiddleName Name(nvarchar(50)) X
Middle name or middle initial of the person.
LastName Name(nvarchar(50))
Last name of the person.
Suffix nvarchar(10) X
Surname suffix. For example, Sr. or Jr.
EmailPromotion int 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 X
Additional contact information about the person stored in xml format.
Demographics xml X
Personal information such as hobbies, and income collected from online shoppers. Used
for sales analysis.
UK rowguid uniqueidentifier newid()
ROWGUIDCOL number uniquely identifying the record. Used to support a merge
replication sample.
ModifiedDate datetime getdate()
Date and time the record was last updated.
Indexes:
BusinessEntityID
AK_Person_rowguid (Unique)
rowguid
PXML_Person_AddContact (XML)
AdditionalContactInfo
PXML_Person_Demographics (XML)
Demographics
XMLPATH_Person_Demographics (XML)
Demographics
Page 15 of 76
XMLPROPERTY_Person_Demographics (XML)
Demographics
XMLVALUE_Person_Demographics (XML)
Demographics
IX_Person_LastName_FirstName_MiddleName
LastName
FirstName
MiddleName
References:
Person.BusinessEntity (BusinessEntityID)
Referenced by:
HumanResources.Employee (BusinessEntityID)
Person.EmailAddress (BusinessEntityID)
Person.Password (BusinessEntityID)
Person.PersonPhone (BusinessEntityID)
Sales.PersonCreditCard (BusinessEntityID)
Triggers:
AFTER INSERT, UPDATE trigger inserting Individual only if the Customer does not exist in the Store table and
setting the ModifiedDate column in the Person table to the current date.
Used by:
Function dbo.ufnGetContactInformation
Procedure dbo.uspGetEmployeeManagers
Procedure dbo.uspGetManagerEmployees
View HumanResources.vEmployee
View HumanResources.vEmployeeDepartment
View HumanResources.vEmployeeDepartmentHistory
View Person.vAdditionalContactInfo
View Purchasing.vVendorWithContacts
View Sales.vIndividualCustomer
View Sales.vPersonDemographics
View Sales.vSalesPerson
Page 16 of 76
View Sales.vSalesPersonSalesByFiscalYears
View Sales.vStoreWithContacts
Person.PersonPhone
Table Person.PersonPhone (19,972 rows)
Indexes:
BusinessEntityID
PhoneNumber
PhoneNumberTypeID
IX_PersonPhone_PhoneNumber
Nonclustered index.
PhoneNumber
References:
Person.Person (BusinessEntityID)
Person.PhoneNumberType (PhoneNumberTypeID)
Used by:
View HumanResources.vEmployee
View Purchasing.vVendorWithContacts
View Sales.vIndividualCustomer
View Sales.vSalesPerson
View Sales.vStoreWithContacts
Person.PhoneNumberType
Table Person.PhoneNumberType (3 rows)
Page 17 of 76
Indexes:
PhoneNumberTypeID
Referenced by:
Person.PersonPhone (PhoneNumberTypeID)
Used by:
View HumanResources.vEmployee
View Purchasing.vVendorWithContacts
View Sales.vIndividualCustomer
View Sales.vSalesPerson
View Sales.vStoreWithContacts
Person.StateProvince
Table Person.StateProvince (181 rows)
Indexes:
StateProvinceID
AK_StateProvince_Name (Unique)
Page 18 of 76
Name
AK_StateProvince_rowguid (Unique)
rowguid
AK_StateProvince_StateProvinceCode_CountryRegionCode (Unique)
StateProvinceCode
CountryRegionCode
References:
Person.CountryRegion (CountryRegionCode)
Sales.SalesTerritory (TerritoryID)
Referenced by:
Person.Address (StateProvinceID)
Sales.SalesTaxRate (StateProvinceID)
Used by:
View HumanResources.vEmployee
View Person.vStateProvinceCountryRegion
View Purchasing.vVendorWithAddresses
View Sales.vIndividualCustomer
View Sales.vSalesPerson
View Sales.vStoreWithAddresses
Production.BillOfMaterials
Table Production.BillOfMaterials (2,679 rows)
Items required to make bicycles and bicycle subassemblies. It identifies the heirarchical relationship between a parent
product and its components.
Page 19 of 76
Indexes:
BillOfMaterialsID
Clustered index.
ProductAssemblyID
ComponentID
StartDate
IX_BillOfMaterials_UnitMeasureCode
Nonclustered index.
UnitMeasureCode
References:
Production.UnitMeasure (UnitMeasureCode)
Used by:
Procedure dbo.uspGetBillOfMaterials
Procedure dbo.uspGetWhereUsedProductID
Production.Culture
Table Production.Culture (8 rows)
Lookup table containing the languages in which some AdventureWorks data is stored.
Indexes:
CultureID
AK_Culture_Name (Unique)
Name
Referenced by:
Production.ProductModelProductDescriptionCulture (CultureID)
Page 20 of 76
Production.Document
Table Production.Document (13 rows)
Indexes:
DocumentNode
AK_Document_DocumentLevel_DocumentNode (Unique)
DocumentLevel
DocumentNode
AK_Document_rowguid (Unique)
rowguid
UQ__Document__F73921F763026E5E (Unique)
rowguid
IX_Document_FileName_Revision
Page 21 of 76
Unique nonclustered index.
FileName
Revision
References:
Referenced by:
Production.ProductDocument (DocumentNode)
Production.Illustration
Table Production.Illustration (5 rows)
Indexes:
IllustrationID
Referenced by:
Production.ProductModelIllustration (IllustrationID)
Production.Location
Table Production.Location (14 rows)
Indexes:
LocationID
Page 22 of 76
AK_Location_Name (Unique)
Name
Referenced by:
Production.ProductInventory (LocationID)
Production.WorkOrderRouting (LocationID)
Production.Product
Table Production.Product (504 rows)
Page 23 of 76
Date the product was available for sale.
SellEndDate datetime X
Date the product was no longer available for sale.
DiscontinuedDate datetime X
Date the product was discontinued.
UK rowguid uniqueidentifier newid()
ROWGUIDCOL number uniquely identifying the record. Used to support a merge
replication sample.
ModifiedDate datetime getdate()
Date and time the record was last updated.
Indexes:
ProductID
AK_Product_Name (Unique)
Name
AK_Product_ProductNumber (Unique)
ProductNumber
AK_Product_rowguid (Unique)
rowguid
References:
Production.ProductModel (ProductModelID)
Production.ProductSubcategory (ProductSubcategoryID)
Referenced by:
Production.ProductCostHistory (ProductID)
Production.ProductDocument (ProductID)
Production.ProductInventory (ProductID)
Production.ProductListPriceHistory (ProductID)
Production.ProductProductPhoto (ProductID)
Production.ProductReview (ProductID)
Production.TransactionHistory (ProductID)
Production.WorkOrder (ProductID)
Purchasing.ProductVendor (ProductID)
Page 24 of 76
Purchasing.PurchaseOrderDetail (ProductID)
Sales.ShoppingCartItem (ProductID)
Sales.SpecialOfferProduct (ProductID)
Used by:
Function dbo.ufnGetProductDealerPrice
Function dbo.ufnGetProductListPrice
Function dbo.ufnGetProductStandardCost
Procedure dbo.uspGetBillOfMaterials
Procedure dbo.uspGetWhereUsedProductID
View Production.vProductAndDescription
Production.ProductCategory
Table Production.ProductCategory (4 rows)
Indexes:
ProductCategoryID
AK_ProductCategory_Name (Unique)
Name
AK_ProductCategory_rowguid (Unique)
rowguid
Referenced by:
Production.ProductSubcategory (ProductCategoryID)
Production.ProductCostHistory
Table Production.ProductCostHistory (395 rows)
Page 25 of 76
PK, FK ProductID int
Product identification number. Foreign key to Product.ProductID
PK StartDate datetime
Product cost start date.
EndDate datetime X
Product cost end date.
StandardCost money
Standard cost of the product.
ModifiedDate datetime getdate()
Date and time the record was last updated.
Indexes:
ProductID
StartDate
References:
Production.Product (ProductID)
Used by:
Function dbo.ufnGetProductStandardCost
Production.ProductDescription
Table Production.ProductDescription (762 rows)
Indexes:
ProductDescriptionID
AK_ProductDescription_rowguid (Unique)
rowguid
Referenced by:
Production.ProductModelProductDescriptionCulture (ProductDescriptionID)
Used by:
Page 26 of 76
View Production.vProductAndDescription
Production.ProductDocument
Table Production.ProductDocument (32 rows)
Indexes:
ProductID
DocumentNode
References:
Production.Document (DocumentNode)
Production.Product (ProductID)
Production.ProductInventory
Table Production.ProductInventory (1,069 rows)
Indexes:
ProductID
LocationID
References:
Production.Location (LocationID)
Page 27 of 76
Production.Product (ProductID)
Used by:
Function dbo.ufnGetStock
Production.ProductListPriceHistory
Table Production.ProductListPriceHistory (395 rows)
Indexes:
ProductID
StartDate
References:
Production.Product (ProductID)
Used by:
Function dbo.ufnGetProductDealerPrice
Function dbo.ufnGetProductListPrice
Production.ProductModel
Table Production.ProductModel (128 rows)
Page 28 of 76
Indexes:
ProductModelID
AK_ProductModel_Name (Unique)
Name
AK_ProductModel_rowguid (Unique)
rowguid
PXML_ProductModel_CatalogDescription (XML)
CatalogDescription
PXML_ProductModel_Instructions (XML)
Instructions
Referenced by:
Production.Product (ProductModelID)
Production.ProductModelIllustration (ProductModelID)
Production.ProductModelProductDescriptionCulture (ProductModelID)
Used by:
View Production.vProductAndDescription
View Production.vProductModelCatalogDescription
View Production.vProductModelInstructions
Production.ProductModelIllustration
Table Production.ProductModelIllustration (7 rows)
Indexes:
ProductModelID
Page 29 of 76
IllustrationID
References:
Production.Illustration (IllustrationID)
Production.ProductModel (ProductModelID)
Production.ProductModelProductDescriptionCulture
Table Production.ProductModelProductDescriptionCulture (762 rows)
Cross-reference table mapping product descriptions and the language the description is written in.
Indexes:
ProductModelID
ProductDescriptionID
CultureID
References:
Production.Culture (CultureID)
Production.ProductDescription (ProductDescriptionID)
Production.ProductModel (ProductModelID)
Used by:
View Production.vProductAndDescription
Production.ProductPhoto
Table Production.ProductPhoto (101 rows)
Product images.
Page 30 of 76
Indexes:
ProductPhotoID
Referenced by:
Production.ProductProductPhoto (ProductPhotoID)
Production.ProductProductPhoto
Table Production.ProductProductPhoto (504 rows)
Indexes:
ProductID
ProductPhotoID
References:
Production.Product (ProductID)
Production.ProductPhoto (ProductPhotoID)
Production.ProductReview
Table Production.ProductReview (4 rows)
Page 31 of 76
ModifiedDate datetime getdate()
Date and time the record was last updated.
Indexes:
ProductReviewID
IX_ProductReview_ProductID_Name
Nonclustered index.
ProductID
ReviewerName
Comments (Included)
References:
Production.Product (ProductID)
Production.ProductSubcategory
Table Production.ProductSubcategory (37 rows)
Indexes:
ProductSubcategoryID
AK_ProductSubcategory_Name (Unique)
Name
AK_ProductSubcategory_rowguid (Unique)
rowguid
References:
Production.ProductCategory (ProductCategoryID)
Referenced by:
Page 32 of 76
Production.Product (ProductSubcategoryID)
Production.ScrapReason
Table Production.ScrapReason (16 rows)
Indexes:
ScrapReasonID
AK_ScrapReason_Name (Unique)
Name
Referenced by:
Production.WorkOrder (ScrapReasonID)
Production.TransactionHistory
Table Production.TransactionHistory (113,443 rows)
Record of each purchase order, sales order, or work order transaction year to date.
Indexes:
Page 33 of 76
PK_TransactionHistory_TransactionID (Primary Key) (Clustered)
TransactionID
IX_TransactionHistory_ProductID
Nonclustered index.
ProductID
IX_TransactionHistory_ReferenceOrderID_ReferenceOrderLineID
Nonclustered index.
ReferenceOrderID
ReferenceOrderLineID
References:
Production.Product (ProductID)
Used by:
Indexes:
Page 34 of 76
Primary key (clustered) constraint
TransactionID
IX_TransactionHistoryArchive_ProductID
Nonclustered index.
ProductID
IX_TransactionHistoryArchive_ReferenceOrderID_ReferenceOrderLineID
Nonclustered index.
ReferenceOrderID
ReferenceOrderLineID
Production.UnitMeasure
Table Production.UnitMeasure (38 rows)
Indexes:
UnitMeasureCode
AK_UnitMeasure_Name (Unique)
Name
Referenced by:
Production.BillOfMaterials (UnitMeasureCode)
Purchasing.ProductVendor (UnitMeasureCode)
Production.WorkOrder
Table Production.WorkOrder (72,591 rows)
Page 35 of 76
StockedQty int
Quantity built and put in inventory.
ScrappedQty smallint
Quantity that failed inspection.
StartDate datetime
Work order start date.
EndDate datetime X
Work order end date.
DueDate datetime
Work order due date.
FK ScrapReasonID smallint X
Reason for inspection failure.
ModifiedDate datetime getdate()
Date and time the record was last updated.
Indexes:
WorkOrderID
IX_WorkOrder_ProductID
Nonclustered index.
ProductID
IX_WorkOrder_ScrapReasonID
Nonclustered index.
ScrapReasonID
References:
Production.Product (ProductID)
Production.ScrapReason (ScrapReasonID)
Referenced by:
Production.WorkOrderRouting (WorkOrderID)
Triggers:
AFTER UPDATE trigger that inserts a row in the TransactionHistory table, updates ModifiedDate in the WorkOrder
table.
Production.WorkOrderRouting
Table Production.WorkOrderRouting (67,131 rows)
Page 36 of 76
PK OperationSequence smallint
Primary key. Indicates the manufacturing process sequence.
FK 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 X
Actual start date.
ActualEndDate datetime X
Actual end date.
ActualResourceHrs decimal(9,4) X
Number of manufacturing hours used.
PlannedCost money
Estimated manufacturing cost.
ActualCost money X
Actual manufacturing cost.
ModifiedDate datetime getdate()
Date and time the record was last updated.
Indexes:
WorkOrderID
ProductID
OperationSequence
IX_WorkOrderRouting_ProductID
Nonclustered index.
ProductID
References:
Production.Location (LocationID)
Production.WorkOrder (WorkOrderID)
Purchasing.ProductVendor
Table Purchasing.ProductVendor (460 rows)
Page 37 of 76
The maximum quantity that should be ordered.
MaxOrderQty int
The minimum quantity that should be ordered.
OnOrderQty int X
The quantity currently on order.
FK UnitMeasureCode nchar(3)
The product's unit of measure.
ModifiedDate datetime getdate()
Date and time the record was last updated.
Indexes:
ProductID
BusinessEntityID
IX_ProductVendor_BusinessEntityID
Nonclustered index.
BusinessEntityID
IX_ProductVendor_UnitMeasureCode
Nonclustered index.
UnitMeasureCode
References:
Production.Product (ProductID)
Production.UnitMeasure (UnitMeasureCode)
Purchasing.Vendor (BusinessEntityID)
Purchasing.PurchaseOrderDetail
Table Purchasing.PurchaseOrderDetail (8,845 rows)
Page 38 of 76
Quantity accepted into inventory. Computed as ReceivedQty - RejectedQty.
ModifiedDate datetime getdate()
Date and time the record was last updated.
Indexes:
PurchaseOrderID
PurchaseOrderDetailID
IX_PurchaseOrderDetail_ProductID
Nonclustered index.
ProductID
References:
Production.Product (ProductID)
Purchasing.PurchaseOrderHeader (PurchaseOrderID)
Triggers:
AFTER INSERT trigger that inserts a row in the TransactionHistory table and updates the
PurchaseOrderHeader.SubTotal column.
AFTER UPDATE trigger that inserts a row in the TransactionHistory table, updates ModifiedDate in
PurchaseOrderDetail and updates the PurchaseOrderHeader.SubTotal column.
Purchasing.PurchaseOrderHeader
Table Purchasing.PurchaseOrderHeader (4,012 rows)
Page 39 of 76
Freight money 0.00
Shipping cost.
TotalDue money
Total due to vendor. Computed as Subtotal + TaxAmt + Freight.
ModifiedDate datetime getdate()
Date and time the record was last updated.
Indexes:
PurchaseOrderID
IX_PurchaseOrderHeader_EmployeeID
Nonclustered index.
EmployeeID
IX_PurchaseOrderHeader_VendorID
Nonclustered index.
VendorID
References:
Purchasing.ShipMethod (ShipMethodID)
Referenced by:
Purchasing.PurchaseOrderDetail (PurchaseOrderID)
Triggers:
AFTER UPDATE trigger that updates the RevisionNumber and ModifiedDate columns in the PurchaseOrderHeader
table.
Used by:
Page 40 of 76
ROWGUIDCOL number uniquely identifying the record. Used to support a merge
replication sample.
ModifiedDate datetime getdate()
Date and time the record was last updated.
Indexes:
ShipMethodID
AK_ShipMethod_Name (Unique)
Name
AK_ShipMethod_rowguid (Unique)
rowguid
Referenced by:
Purchasing.PurchaseOrderHeader (ShipMethodID)
Sales.SalesOrderHeader (ShipMethodID)
Purchasing.Vendor
Table Purchasing.Vendor (104 rows)
Companies from whom Adventure Works Cycles purchases parts or other goods.
Indexes:
BusinessEntityID
AK_Vendor_AccountNumber (Unique)
Page 41 of 76
Unique nonclustered index.
AccountNumber
References:
Person.BusinessEntity (BusinessEntityID)
Referenced by:
Purchasing.ProductVendor (BusinessEntityID)
Triggers:
Used by:
Function dbo.ufnGetContactInformation
View Purchasing.vVendorWithAddresses
View Purchasing.vVendorWithContacts
Sales.CountryRegionCurrency
Table Sales.CountryRegionCurrency (109 rows)
Indexes:
CountryRegionCode
CurrencyCode
IX_CountryRegionCurrency_CurrencyCode
Nonclustered index.
CurrencyCode
References:
Person.CountryRegion (CountryRegionCode)
Sales.Currency (CurrencyCode)
Sales.CreditCard
Table Sales.CreditCard (19,118 rows)
Page 42 of 76
Column Data Type Identity Nullable Default
PK CreditCardID int X
Primary key for CreditCard records.
CardType nvarchar(50)
Credit card name.
UK CardNumber nvarchar(25)
Credit card number.
ExpMonth tinyint
Credit card expiration month.
ExpYear smallint
Credit card expiration year.
ModifiedDate datetime getdate()
Date and time the record was last updated.
Indexes:
CreditCardID
AK_CreditCard_CardNumber (Unique)
CardNumber
Referenced by:
Sales.PersonCreditCard (CreditCardID)
Sales.SalesOrderHeader (CreditCardID)
Sales.Currency
Table Sales.Currency (105 rows)
Indexes:
CurrencyCode
AK_Currency_Name (Unique)
Name
Referenced by:
Sales.CountryRegionCurrency (CurrencyCode)
Page 43 of 76
Sales.CurrencyRate (FromCurrencyCode -> CurrencyCode)
Indexes:
CurrencyRateID
AK_CurrencyRate_CurrencyRateDate_FromCurrencyCode_ToCurrencyCode (Unique)
CurrencyRateDate
FromCurrencyCode
ToCurrencyCode
References:
Referenced by:
Sales.SalesOrderHeader (CurrencyRateID)
Sales.Customer
Table Sales.Customer (19,820 rows)
Current customer information. Also see the Person and Store tables.
Page 44 of 76
FK TerritoryID int X
ID of the territory in which the customer is located. Foreign key to
SalesTerritory.SalesTerritoryID.
UK AccountNumber varchar(10)
Unique number identifying the customer assigned by the accounting system.
UK rowguid uniqueidentifier newid()
ROWGUIDCOL number uniquely identifying the record. Used to support a merge
replication sample.
ModifiedDate datetime getdate()
Date and time the record was last updated.
Indexes:
CustomerID
AK_Customer_AccountNumber (Unique)
AccountNumber
AK_Customer_rowguid (Unique)
rowguid
IX_Customer_TerritoryID
Nonclustered index.
TerritoryID
References:
Sales.SalesTerritory (TerritoryID)
Referenced by:
Sales.SalesOrderHeader (CustomerID)
Used by:
Function dbo.ufnGetContactInformation
View Sales.vIndividualCustomer
Sales.PersonCreditCard
Table Sales.PersonCreditCard (19,118 rows)
Cross-reference table mapping people to their credit card information in the CreditCard table.
Page 45 of 76
ModifiedDate datetime getdate()
Date and time the record was last updated.
Indexes:
BusinessEntityID
CreditCardID
References:
Person.Person (BusinessEntityID)
Sales.CreditCard (CreditCardID)
Sales.SalesOrderDetail
Table Sales.SalesOrderDetail (121,317 rows)
Indexes:
SalesOrderID
SalesOrderDetailID
AK_SalesOrderDetail_rowguid (Unique)
rowguid
Page 46 of 76
IX_SalesOrderDetail_ProductID
Nonclustered index.
ProductID
References:
Sales.SalesOrderHeader (SalesOrderID)
Triggers:
AFTER INSERT, DELETE, UPDATE trigger that inserts a row in the TransactionHistory table, updates ModifiedDate in
SalesOrderDetail and updates the SalesOrderHeader.SubTotal column.
Sales.SalesOrderHeader
Table Sales.SalesOrderHeader (31,465 rows)
Page 47 of 76
FK CurrencyRateID int X
Currency exchange rate used. Foreign key to CurrencyRate.CurrencyRateID.
SubTotal money 0.00
Sales subtotal. Computed as SUM(SalesOrderDetail.LineTotal)for the appropriate
SalesOrderID.
TaxAmt money 0.00
Tax amount.
Freight money 0.00
Shipping cost.
TotalDue money
Total due from customer. Computed as Subtotal + TaxAmt + Freight.
Comment nvarchar(128) X
Sales representative comments.
UK rowguid uniqueidentifier newid()
ROWGUIDCOL number uniquely identifying the record. Used to support a merge
replication sample.
ModifiedDate datetime getdate()
Date and time the record was last updated.
Indexes:
SalesOrderID
AK_SalesOrderHeader_rowguid (Unique)
rowguid
AK_SalesOrderHeader_SalesOrderNumber (Unique)
SalesOrderNumber
IX_SalesOrderHeader_CustomerID
Nonclustered index.
CustomerID
IX_SalesOrderHeader_SalesPersonID
Nonclustered index.
SalesPersonID
References:
Purchasing.ShipMethod (ShipMethodID)
Sales.CreditCard (CreditCardID)
Sales.CurrencyRate (CurrencyRateID)
Sales.Customer (CustomerID)
Page 48 of 76
Sales.SalesTerritory (TerritoryID)
Referenced by:
Sales.SalesOrderDetail (SalesOrderID)
Sales.SalesOrderHeaderSalesReason (SalesOrderID)
Triggers:
AFTER UPDATE trigger that updates the RevisionNumber and ModifiedDate columns in the SalesOrderHeader
table.Updates the SalesYTD column in the SalesPerson and SalesTerritory tables.
Used by:
View Sales.vSalesPersonSalesByFiscalYears
Sales.SalesOrderHeaderSalesReason
Table Sales.SalesOrderHeaderSalesReason (27,647 rows)
Indexes:
SalesOrderID
SalesReasonID
References:
Sales.SalesOrderHeader (SalesOrderID)
Sales.SalesReason (SalesReasonID)
Sales.SalesPerson
Table Sales.SalesPerson (17 rows)
Page 49 of 76
SalesYTD money 0.00
Sales total year to date.
SalesLastYear money 0.00
Sales total of previous year.
UK rowguid uniqueidentifier newid()
ROWGUIDCOL number uniquely identifying the record. Used to support a merge
replication sample.
ModifiedDate datetime getdate()
Date and time the record was last updated.
Indexes:
BusinessEntityID
AK_SalesPerson_rowguid (Unique)
rowguid
References:
HumanResources.Employee (BusinessEntityID)
Sales.SalesTerritory (TerritoryID)
Referenced by:
Sales.SalesPersonQuotaHistory (BusinessEntityID)
Sales.SalesTerritoryHistory (BusinessEntityID)
Used by:
View Sales.vSalesPerson
View Sales.vSalesPersonSalesByFiscalYears
Sales.SalesPersonQuotaHistory
Table Sales.SalesPersonQuotaHistory (163 rows)
Page 50 of 76
Indexes:
BusinessEntityID
QuotaDate
AK_SalesPersonQuotaHistory_rowguid (Unique)
rowguid
References:
Sales.SalesPerson (BusinessEntityID)
Sales.SalesReason
Table Sales.SalesReason (10 rows)
Indexes:
SalesReasonID
Referenced by:
Sales.SalesOrderHeaderSalesReason (SalesReasonID)
Sales.SalesTaxRate
Table Sales.SalesTaxRate (29 rows)
Page 51 of 76
ROWGUIDCOL number uniquely identifying the record. Used to support a merge
replication sample.
ModifiedDate datetime getdate()
Date and time the record was last updated.
Indexes:
SalesTaxRateID
AK_SalesTaxRate_rowguid (Unique)
rowguid
AK_SalesTaxRate_StateProvinceID_TaxType (Unique)
StateProvinceID
TaxType
References:
Person.StateProvince (StateProvinceID)
Sales.SalesTerritory
Table Sales.SalesTerritory (10 rows)
Indexes:
Page 52 of 76
Primary key (clustered) constraint
TerritoryID
AK_SalesTerritory_Name (Unique)
Name
AK_SalesTerritory_rowguid (Unique)
rowguid
References:
Person.CountryRegion (CountryRegionCode)
Referenced by:
Person.StateProvince (TerritoryID)
Sales.Customer (TerritoryID)
Sales.SalesOrderHeader (TerritoryID)
Sales.SalesPerson (TerritoryID)
Sales.SalesTerritoryHistory (TerritoryID)
Used by:
View Sales.vSalesPerson
View Sales.vSalesPersonSalesByFiscalYears
Sales.SalesTerritoryHistory
Table Sales.SalesTerritoryHistory (17 rows)
Indexes:
Page 53 of 76
BusinessEntityID
StartDate
TerritoryID
AK_SalesTerritoryHistory_rowguid (Unique)
rowguid
References:
Sales.SalesPerson (BusinessEntityID)
Sales.SalesTerritory (TerritoryID)
Sales.ShoppingCartItem
Table Sales.ShoppingCartItem (3 rows)
Indexes:
ShoppingCartItemID
IX_ShoppingCartItem_ShoppingCartID_ProductID
Nonclustered index.
ShoppingCartID
ProductID
References:
Production.Product (ProductID)
Sales.SpecialOffer
Table Sales.SpecialOffer (16 rows)
Page 54 of 76
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 0
Minimum discount percent allowed.
MaxQty int X
Maximum discount percent allowed.
UK rowguid uniqueidentifier newid()
ROWGUIDCOL number uniquely identifying the record. Used to support a merge
replication sample.
ModifiedDate datetime getdate()
Date and time the record was last updated.
Indexes:
SpecialOfferID
AK_SpecialOffer_rowguid (Unique)
rowguid
Referenced by:
Sales.SpecialOfferProduct (SpecialOfferID)
Sales.SpecialOfferProduct
Table Sales.SpecialOfferProduct (538 rows)
Indexes:
SpecialOfferID
ProductID
Page 55 of 76
AK_SpecialOfferProduct_rowguid (Unique)
rowguid
IX_SpecialOfferProduct_ProductID
Nonclustered index.
ProductID
References:
Production.Product (ProductID)
Sales.SpecialOffer (SpecialOfferID)
Referenced by:
Indexes:
BusinessEntityID
AK_Store_rowguid (Unique)
rowguid
PXML_Store_Demographics (XML)
Demographics
IX_Store_SalesPersonID
Page 56 of 76
Nonclustered index.
SalesPersonID
References:
Person.BusinessEntity (BusinessEntityID)
Referenced by:
Used by:
Function dbo.ufnGetContactInformation
View Sales.vStoreWithAddresses
View Sales.vStoreWithContacts
View Sales.vStoreWithDemographics
Page 57 of 76
Views
Views:
HumanResources.vEmployee
View HumanResources.vEmployee
Uses:
Table HumanResources.Employee
Table Person.Address
Table Person.BusinessEntityAddress
Table Person.CountryRegion
Table Person.EmailAddress
Table Person.Person
Table Person.PersonPhone
Table Person.PhoneNumberType
Table Person.StateProvince
HumanResources.vEmployeeDepartment
View HumanResources.vEmployeeDepartment
Page 58 of 76
Uses:
Table HumanResources.Department
Table HumanResources.Employee
Table HumanResources.EmployeeDepartmentHistory
Table Person.Person
HumanResources.vEmployeeDepartmentHistory
View HumanResources.vEmployeeDepartmentHistory
Uses:
Table HumanResources.Department
Table HumanResources.Employee
Table HumanResources.EmployeeDepartmentHistory
Table HumanResources.Shift
Table Person.Person
HumanResources.vJobCandidate
View HumanResources.vJobCandidate
Page 59 of 76
ModifiedDate datetime
Uses:
Table HumanResources.JobCandidate
HumanResources.vJobCandidateEducation
View HumanResources.vJobCandidateEducation
Displays the content from each education related element in the xml column Resume in the HumanResources.JobCandidate
table. The content has been localized into French, Simplified Chinese and Thai. Some data may not display correctly unless
supplemental language support is installed.
Uses:
Table HumanResources.JobCandidate
HumanResources.vJobCandidateEmployment
View HumanResources.vJobCandidateEmployment
Displays the content from each employement history related element in the xml column Resume in the
HumanResources.JobCandidate table. The content has been localized into French, Simplified Chinese and Thai. Some data may not
display correctly unless supplemental language support is installed.
Uses:
Table HumanResources.JobCandidate
Person.vAdditionalContactInfo
View Person.vAdditionalContactInfo
Displays the contact name and content from each element in the xml column AdditionalContactInfo for that person.
Page 60 of 76
Column Data Type Nullable
BusinessEntityID int
FirstName Name(nvarchar(50))
MiddleName Name(nvarchar(50)) X
LastName Name(nvarchar(50))
TelephoneNumber nvarchar(50) X
TelephoneSpecialInstructions nvarchar(max) X
Street nvarchar(50) X
City nvarchar(50) X
StateProvince nvarchar(50) X
PostalCode nvarchar(50) X
CountryRegion nvarchar(50) X
HomeAddressSpecialInstructions nvarchar(max) X
EMailAddress nvarchar(128) X
EMailSpecialInstructions nvarchar(max) X
EMailTelephoneNumber nvarchar(50) X
rowguid uniqueidentifier
ModifiedDate datetime
Uses:
Table Person.Person
Person.vStateProvinceCountryRegion
View Person.vStateProvinceCountryRegion
Uses:
Table Person.CountryRegion
Table Person.StateProvince
Production.vProductAndDescription
View Production.vProductAndDescription
Product names and descriptions. Product descriptions are provided in multiple languages.
Uses:
Table Production.Product
Page 61 of 76
Table Production.ProductDescription
Table Production.ProductModel
Table Production.ProductModelProductDescriptionCulture
Production.vProductModelCatalogDescription
View Production.vProductModelCatalogDescription
Displays the content from each element in the xml column CatalogDescription for each product in the
Production.ProductModel table that has catalog data.
Uses:
Table Production.ProductModel
Production.vProductModelInstructions
View Production.vProductModelInstructions
Displays the content from each element in the xml column Instructions for each product in the Production.ProductModel
table that has manufacturing instructions.
Page 62 of 76
ModifiedDate datetime
Uses:
Table Production.ProductModel
Purchasing.vVendorWithAddresses
View Purchasing.vVendorWithAddresses
Uses:
Table Person.Address
Table Person.AddressType
Table Person.BusinessEntityAddress
Table Person.CountryRegion
Table Person.StateProvince
Table Purchasing.Vendor
Purchasing.vVendorWithContacts
View Purchasing.vVendorWithContacts
Uses:
Table Person.BusinessEntityContact
Table Person.ContactType
Page 63 of 76
Table Person.EmailAddress
Table Person.Person
Table Person.PersonPhone
Table Person.PhoneNumberType
Table Purchasing.Vendor
Sales.vIndividualCustomer
View Sales.vIndividualCustomer
Individual customers (names and addresses) that purchase Adventure Works Cycles products online.
Uses:
Table Person.Address
Table Person.AddressType
Table Person.BusinessEntityAddress
Table Person.CountryRegion
Table Person.EmailAddress
Table Person.Person
Table Person.PersonPhone
Table Person.PhoneNumberType
Table Person.StateProvince
Table Sales.Customer
Sales.vPersonDemographics
View Sales.vPersonDemographics
Displays the content from each element in the xml column Demographics for each customer in the Person.Person table.
Page 64 of 76
DateFirstPurchase datetime X
BirthDate datetime X
MaritalStatus nvarchar(1) X
YearlyIncome nvarchar(30) X
Gender nvarchar(1) X
TotalChildren int X
NumberChildrenAtHome int X
Education nvarchar(30) X
Occupation nvarchar(30) X
HomeOwnerFlag bit X
NumberCarsOwned int X
Uses:
Table Person.Person
Sales.vSalesPerson
View Sales.vSalesPerson
Uses:
Table HumanResources.Employee
Table Person.Address
Table Person.BusinessEntityAddress
Table Person.CountryRegion
Table Person.EmailAddress
Table Person.Person
Table Person.PersonPhone
Page 65 of 76
Table Person.PhoneNumberType
Table Person.StateProvince
Table Sales.SalesPerson
Table Sales.SalesTerritory
Sales.vSalesPersonSalesByFiscalYears
View Sales.vSalesPersonSalesByFiscalYears
Uses PIVOT to return aggregated sales information for each sales representative.
Uses:
Table HumanResources.Employee
Table Person.Person
Table Sales.SalesOrderHeader
Table Sales.SalesPerson
Table Sales.SalesTerritory
Sales.vStoreWithAddresses
View Sales.vStoreWithAddresses
Stores (including store addresses) that sell Adventure Works Cycles products to consumers.
Uses:
Table Person.Address
Table Person.AddressType
Table Person.BusinessEntityAddress
Table Person.CountryRegion
Table Person.StateProvince
Table Sales.Store
Sales.vStoreWithContacts
Page 66 of 76
View Sales.vStoreWithContacts
Stores (including store contacts) that sell Adventure Works Cycles products to consumers.
Uses:
Table Person.BusinessEntityContact
Table Person.ContactType
Table Person.EmailAddress
Table Person.Person
Table Person.PersonPhone
Table Person.PhoneNumberType
Table Sales.Store
Sales.vStoreWithDemographics
View Sales.vStoreWithDemographics
Stores (including demographics) that sell Adventure Works Cycles products to consumers.
Uses:
Table Sales.Store
Page 67 of 76
Procedures
Procedures:
dbo.uspGetBillOfMaterials
Procedure dbo.uspGetBillOfMaterials
Stored procedure using a recursive query to return a multi-level bill of material for the specified ProductID.
Result:
Uses:
Table Production.BillOfMaterials
Table Production.Product
dbo.uspGetEmployeeManagers
Procedure dbo.uspGetEmployeeManagers
Stored procedure using a recursive query to return the direct and indirect managers of the specified employee.
Result:
Uses:
Table HumanResources.Employee
Page 68 of 76
Table Person.Person
dbo.uspGetManagerEmployees
Procedure dbo.uspGetManagerEmployees
Stored procedure using a recursive query to return the direct and indirect employees of the specified manager.
Result:
Uses:
Table HumanResources.Employee
Table Person.Person
dbo.uspGetWhereUsedProductID
Procedure dbo.uspGetWhereUsedProductID
Stored procedure using a recursive query to return all components or assemblies that directly or indirectly use the specified
ProductID.
Result:
Uses:
Page 69 of 76
Table Production.BillOfMaterials
Table Production.Product
dbo.uspLogError
Procedure dbo.uspLogError
Logs error information in the ErrorLog table about the error that caused execution to jump to the CATCH block of a
TRY...CATCH construct. Should be executed from within the scope of a CATCH block otherwise it will return without inserting error
information.
Used by:
Procedure HumanResources.uspUpdateEmployeeHireInfo
Procedure HumanResources.uspUpdateEmployeeLogin
Procedure HumanResources.uspUpdateEmployeePersonalInfo
Uses:
Procedure dbo.uspPrintError
Table dbo.ErrorLog
dbo.uspPrintError
Procedure dbo.uspPrintError
Prints error information about the error that caused execution to jump to the CATCH block of a TRY...CATCH construct.
Should be executed from within the scope of a CATCH block otherwise it will return without printing any error information.
No parameters.
Used by:
Procedure dbo.uspLogError
Page 70 of 76
Trigger uPurchaseOrderHeader on Purchasing.PurchaseOrderHeader
Uses:
Table HumanResources.JobCandidate
HumanResources.uspUpdateEmployeeHireInfo
Procedure HumanResources.uspUpdateEmployeeHireInfo
Updates the Employee table and inserts a new row in the EmployeePayHistory table with the values specified in the input
parameters.
Uses:
Procedure dbo.uspLogError
Table HumanResources.Employee
Table HumanResources.EmployeePayHistory
HumanResources.uspUpdateEmployeeLogin
Procedure HumanResources.uspUpdateEmployeeLogin
Page 71 of 76
Updates the Employee table with the values specified in the input parameters for the given BusinessEntityID.
Uses:
Procedure dbo.uspLogError
Table HumanResources.Employee
HumanResources.uspUpdateEmployeePersonalInfo
Procedure HumanResources.uspUpdateEmployeePersonalInfo
Updates the Employee table with the values specified in the input parameters for the given EmployeeID.
Uses:
Procedure dbo.uspLogError
Table HumanResources.Employee
Page 72 of 76
Functions
Functions:
dbo.ufnGetAccountingEndDate
Scalar Function dbo.ufnGetAccountingEndDate
Scalar function used in the uSalesOrderHeader trigger to set the starting account date.
No parameters.
Result:
Scalar function used in the uSalesOrderHeader trigger to set the ending account date.
No parameters.
Result:
Table value function returning the first name, last name, job title and contact type for a given contact.
Result:
Uses:
Table HumanResources.Employee
Table Person.BusinessEntityContact
Table Person.ContactType
Table Person.Person
Table Purchasing.Vendor
Table Sales.Customer
Table Sales.Store
dbo.ufnGetDocumentStatusText
Page 73 of 76
Scalar Function dbo.ufnGetDocumentStatusText
Scalar function returning the text representation of the Status column in the Document table.
Result:
Scalar function returning the dealer price for a given product on a particular order date.
Result:
Uses:
Table Production.Product
Table Production.ProductListPriceHistory
dbo.ufnGetProductListPrice
Scalar Function dbo.ufnGetProductListPrice
Scalar function returning the list price for a given product on a particular order date.
Result:
Uses:
Table Production.Product
Page 74 of 76
Table Production.ProductListPriceHistory
dbo.ufnGetProductStandardCost
Scalar Function dbo.ufnGetProductStandardCost
Scalar function returning the standard cost for a given product on a particular order date.
Result:
Uses:
Table Production.Product
Table Production.ProductCostHistory
dbo.ufnGetPurchaseOrderStatusText
Scalar Function dbo.ufnGetPurchaseOrderStatusText
Scalar function returning the text representation of the Status column in the PurchaseOrderHeader table.
Result:
Scalar function returning the text representation of the Status column in the SalesOrderHeader table.
Result:
Page 75 of 76
Scalar function returning the quantity of inventory in LocationID 6 (Miscellaneous Storage)for a specified ProductID.
Result:
Uses:
Table Production.ProductInventory
dbo.ufnLeadingZeros
Scalar Function dbo.ufnLeadingZeros
Scalar function used by the Sales.Customer table to help set the account number.
Result:
Used by:
Table Sales.Customer
Page 76 of 76