AdventureWorks Database

AdventureWorks Sample OLTP Database

dbo (schema)

Primary filegroup for the AdventureWorks sample database.

Object TypeCount
Tables3
Views0
Stored procedures6
Scalar functions10
Table functions1

dbo.AWBuildVersion (table)

Current version number of the AdventureWorks sample database.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
SystemInformationIDtinyint (identity)3,0NononeNoPrimary key for AWBuildVersion records.
Database Versionnvarchar25NononeNoVersion number of the database in 9.yy.mm.dd.00 format.
VersionDatedatetimeNononeNoDate and time the record was last updated.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on AWBuildVersion
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
PK_AWBuildVersion_SystemInformationIDClustered index created by a primary key constraint.YesYesCLUSTEREDSystemInformationID

dbo.DatabaseLog (table)

Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
DatabaseLogIDint (identity)10,0NononeNoPrimary key for DatabaseLog records.
PostTimedatetimeNononeNoThe date and time the DDL change occurred.
DatabaseUsernvarchar128NononeNoThe user who implemented the DDL change.
Eventnvarchar128NononeNoThe type of DDL statement that was executed.
Schemanvarchar128YesnoneNoThe schema to which the changed object belongs.
Objectnvarchar128YesnoneNoThe object that was changed by the DDL statment.
TSQLnvarcharNononeNoThe exact Transact-SQL statement that was executed.
XmlEventxmlNononeNoThe raw XML data generated by database trigger.
Indexes on DatabaseLog
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
PK_DatabaseLog_DatabaseLogIDNonclustered index created by a primary key constraint.YesYesNONCLUSTEREDDatabaseLogID

dbo.ErrorLog (table)

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.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
ErrorLogIDint (identity)10,0NononeNoPrimary key for ErrorLog records.
ErrorTimedatetimeNo(getdate())NoThe date and time at which the error occurred.
UserNamenvarchar128NononeNoThe user who executed the batch in which the error occurred.
ErrorNumberint10,0NononeNoThe error number of the error that occurred.
ErrorSeverityint10,0YesnoneNoThe severity of the error that occurred.
ErrorStateint10,0YesnoneNoThe state number of the error that occurred.
ErrorProcedurenvarchar126YesnoneNoThe name of the stored procedure or trigger where the error occurred.
ErrorLineint10,0YesnoneNoThe line number at which the error occurred.
ErrorMessagenvarchar4000NononeNoThe message text of the error that occurred.
Indexes on ErrorLog
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
PK_ErrorLog_ErrorLogIDClustered index created by a primary key constraint.YesYesCLUSTEREDErrorLogID

dbo.uspGetBillOfMaterials (stored procedure)

Stored procedure using a recursive query to return a multi-level bill of material for the specified ProductID.

Parameters
Paramater NameSystem Data TypeSizeDirectionDescription
@StartProductIDint10,0InputInput parameter for the stored procedure uspGetBillOfMaterials. Enter a valid ProductID from the Production.Product table.
@CheckDatedatetimeInputInput parameter for the stored procedure uspGetBillOfMaterials used to eliminate components not used after that date. Enter a valid date.

dbo.uspGetEmployeeManagers (stored procedure)

Stored procedure using a recursive query to return the direct and indirect managers of the specified employee.

Parameters
Paramater NameSystem Data TypeSizeDirectionDescription
@EmployeeIDint10,0InputInput parameter for the stored procedure uspGetEmployeeManagers. Enter a valid EmployeeID from the HumanResources.Employee table.

dbo.uspGetManagerEmployees (stored procedure)

Stored procedure using a recursive query to return the direct and indirect employees of the specified manager.

Parameters
Paramater NameSystem Data TypeSizeDirectionDescription
@ManagerIDint10,0InputInput parameter for the stored procedure uspGetManagerEmployees. Enter a valid ManagerID from the HumanResources.Employee table.

dbo.uspGetWhereUsedProductID (stored procedure)

Stored procedure using a recursive query to return all components or assemblies that directly or indirectly use the specified ProductID.

Parameters
Paramater NameSystem Data TypeSizeDirectionDescription
@StartProductIDint10,0InputInput parameter for the stored procedure uspGetWhereUsedProductID. Enter a valid ProductID from the Production.Product table.
@CheckDatedatetimeInputInput parameter for the stored procedure uspGetWhereUsedProductID used to eliminate components not used after that date. Enter a valid date.

dbo.uspLogError (stored procedure)

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.

Parameters
Paramater NameSystem Data TypeSizeDirectionDescription
@ErrorLogIDint10,0OutputOutput parameter for the stored procedure uspLogError. Contains the ErrorLogID value corresponding to the row inserted by uspLogError in the ErrorLog table.

dbo.uspPrintError (stored procedure)

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.ufnGetAccountingEndDate (scalar function)

Scalar function used in the uSalesOrderHeader trigger to set the starting account date.

Returns datetime

dbo.ufnGetAccountingStartDate (scalar function)

Scalar function used in the uSalesOrderHeader trigger to set the ending account date.

Returns datetime

dbo.ufnGetDocumentStatusText (scalar function)

Scalar function returning the text representation of the Status column in the Document table.

Returns nvarchar(16)

Parameters
Paramater NameSystem Data TypeSizeDescription
@Statustinyint3,0Input parameter for the scalar function ufnGetDocumentStatusText. Enter a valid integer.

dbo.ufnGetProductDealerPrice (scalar function)

Scalar function returning the dealer price for a given product on a particular order date.

Returns money(19,4)

Parameters
Paramater NameSystem Data TypeSizeDescription
@ProductIDint10,0Input parameter for the scalar function ufnGetProductDealerPrice. Enter a valid ProductID from the Production.Product table.
@OrderDatedatetimeInput parameter for the scalar function ufnGetProductDealerPrice. Enter a valid order date.

dbo.ufnGetProductListPrice (scalar function)

Scalar function returning the list price for a given product on a particular order date.

Returns money(19,4)

Parameters
Paramater NameSystem Data TypeSizeDescription
@ProductIDint10,0Input parameter for the scalar function ufnGetProductListPrice. Enter a valid ProductID from the Production.Product table.
@OrderDatedatetimeInput parameter for the scalar function ufnGetProductListPrice. Enter a valid order date.

dbo.ufnGetProductStandardCost (scalar function)

Scalar function returning the standard cost for a given product on a particular order date.

Returns money(19,4)

Parameters
Paramater NameSystem Data TypeSizeDescription
@ProductIDint10,0Input parameter for the scalar function ufnGetProductStandardCost. Enter a valid ProductID from the Production.Product table.
@OrderDatedatetimeInput parameter for the scalar function ufnGetProductStandardCost. Enter a valid order date.

dbo.ufnGetPurchaseOrderStatusText (scalar function)

Scalar function returning the text representation of the Status column in the PurchaseOrderHeader table.

Returns nvarchar(15)

Parameters
Paramater NameSystem Data TypeSizeDescription
@Statustinyint3,0Input parameter for the scalar function ufnGetPurchaseOrdertStatusText. Enter a valid integer.

dbo.ufnGetSalesOrderStatusText (scalar function)

Scalar function returning the text representation of the Status column in the SalesOrderHeader table.

Returns nvarchar(15)

Parameters
Paramater NameSystem Data TypeSizeDescription
@Statustinyint3,0Input parameter for the scalar function ufnGetSalesOrderStatusText. Enter a valid integer.

dbo.ufnGetStock (scalar function)

Scalar function returning the quantity of inventory in LocationID 6 (Miscellaneous Storage)for a specified ProductID.

Returns int(10,0)

Parameters
Paramater NameSystem Data TypeSizeDescription
@ProductIDint10,0Input parameter for the scalar function ufnGetStock. Enter a valid ProductID from the Production.ProductInventory table.

dbo.ufnLeadingZeros (scalar function)

Scalar function used by the Sales.Customer table to help set the account number.

Returns varchar(8)

Parameters
Paramater NameSystem Data TypeSizeDescription
@Valueint10,0Input parameter for the scalar function ufnLeadingZeros. Enter a valid integer.

dbo.ufnGetContactInformation (table function)

Table value function returning the first name, last name, job title and contact type for a given contact.

Parameters
Paramater NameSystem Data TypeSizeDescription
@ContactIDint10,0Input parameter for the table value function ufnGetContactInformation. Enter a valid ContactID from the Person.Contact table.
Column NameSystem Data TypeAllow Null
ContactIDintNo
FirstNamenvarcharYes
LastNamenvarcharYes
JobTitlenvarcharYes
ContactTypenvarcharYes

guest (schema)

Object TypeCount
Tables0
Views0
Stored procedures0
Scalar functions0
Table functions0

HumanResources (schema)

Contains objects related to employees and departments.

Object TypeCount
Tables7
Views6
Stored procedures3
Scalar functions0
Table functions0

HumanResources.Department (table)

Lookup table containing the departments within the Adventure Works Cycles company.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
DepartmentIDsmallint (identity)5,0NononeNoPrimary key for Department records.
Namenvarchar50NononeNoName of the department.
GroupNamenvarchar50NononeNoName of the group to which the department belongs.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on Department
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_Department_NameUnique nonclustered index.NoYesNONCLUSTEREDName
PK_Department_DepartmentIDClustered index created by a primary key constraint.YesYesCLUSTEREDDepartmentID

HumanResources.Employee (table)

Employee information such as salary, department, and title.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
EmployeeIDint (identity)10,0NononeNoPrimary key for Employee records.
NationalIDNumbernvarchar15NononeNoUnique national identification number such as a social security number.
ContactIDint10,0NononeNoIdentifies the employee in the Contact table. Foreign key to Contact.ContactID.
LoginIDnvarchar256NononeNoNetwork login.
ManagerIDint10,0YesnoneNoManager to whom the employee is assigned. Foreign Key to Employee.M
Titlenvarchar50NononeNoWork title such as Buyer or Sales Representative.
BirthDatedatetimeNononeNoDate of birth.
MaritalStatusnchar1NononeNoM = Married, S = Single
Gendernchar1NononeNoM = Male, F = Female
HireDatedatetimeNononeNoEmployee hired on this date.
SalariedFlagbitNo((1))NoJob classification. 0 = Hourly, not exempt from collective bargaining. 1 = Salaried, exempt from collective bargaining.
VacationHourssmallint5,0No((0))NoNumber of available vacation hours.
SickLeaveHourssmallint5,0No((0))NoNumber of available sick leave hours.
CurrentFlagbitNo((1))No0 = Inactive, 1 = Active
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on Employee
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_Employee_LoginIDUnique nonclustered index.NoYesNONCLUSTEREDLoginID
AK_Employee_NationalIDNumberUnique nonclustered index.NoYesNONCLUSTEREDNationalIDNumber
AK_Employee_rowguidUnique nonclustered index. Used to support replication samples.NoYesNONCLUSTEREDrowguid
IX_Employee_ManagerIDNonclustered index.NoNoNONCLUSTEREDManagerID
PK_Employee_EmployeeIDClustered index created by a primary key constraint.YesYesCLUSTEREDEmployeeID
Foreign Keys in Employee
Foreign Key NameColumnsReferences Table (Columns)Description
FK_Employee_Contact_ContactIDContactIDPerson.Contact (ContactID)Foreign key constraint referencing Contact.ContactID.
FK_Employee_Employee_ManagerIDManagerIDHumanResources.Employee (EmployeeID)Foreign key constraint referencing Employee.ManagerID.

HumanResources.EmployeeAddress (table)

Cross-reference table mapping employees to their address(es).
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
EmployeeIDint10,0NononeNoPrimary key. Foreign key to Employee.EmployeeID.
AddressIDint10,0NononeNoPrimary key. Foreign key to Address.AddressID.
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on EmployeeAddress
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_EmployeeAddress_rowguidUnique nonclustered index. Used to support replication samples.NoYesNONCLUSTEREDrowguid
PK_EmployeeAddress_EmployeeID_AddressIDClustered index created by a primary key constraint.YesYesCLUSTEREDEmployeeID, AddressID
Foreign Keys in EmployeeAddress
Foreign Key NameColumnsReferences Table (Columns)Description
FK_EmployeeAddress_Address_AddressIDAddressIDPerson.Address (AddressID)Foreign key constraint referencing Address.AddressID.
FK_EmployeeAddress_Employee_EmployeeIDEmployeeIDHumanResources.Employee (EmployeeID)Foreign key constraint referencing Employee.EmployeeID.

HumanResources.EmployeeDepartmentHistory (table)

Employee department transfers.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
EmployeeIDint10,0NononeNoEmployee identification number. Foreign key to Employee.EmployeeID.
DepartmentIDsmallint5,0NononeNoDepartment in which the employee worked including currently. Foreign key to Department.DepartmentID.
ShiftIDtinyint3,0NononeNoIdentifies which 8-hour shift the employee works. Foreign key to Shift.Shift.ID.
StartDatedatetimeNononeNoDate the employee started work in the department.
EndDatedatetimeYesnoneNoDate the employee left the department. NULL = Current department.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on EmployeeDepartmentHistory
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
IX_EmployeeDepartmentHistory_DepartmentIDNonclustered index.NoNoNONCLUSTEREDDepartmentID
IX_EmployeeDepartmentHistory_ShiftIDNonclustered index.NoNoNONCLUSTEREDShiftID
PK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentIDClustered index created by a primary key constraint.YesYesCLUSTEREDEmployeeID, StartDate, DepartmentID, ShiftID
Foreign Keys in EmployeeDepartmentHistory
Foreign Key NameColumnsReferences Table (Columns)Description
FK_EmployeeDepartmentHistory_Department_DepartmentIDDepartmentIDHumanResources.Department (DepartmentID)Foreign key constraint referencing Department.DepartmentID.
FK_EmployeeDepartmentHistory_Employee_EmployeeIDEmployeeIDHumanResources.Employee (EmployeeID)Foreign key constraint referencing Employee.EmployeeID.
FK_EmployeeDepartmentHistory_Shift_ShiftIDShiftIDHumanResources.Shift (ShiftID)Foreign key constraint referencing Shift.ShiftID

HumanResources.EmployeePayHistory (table)

Employee pay history.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
EmployeeIDint10,0NononeNoEmployee identification number. Foreign key to Employee.EmployeeID.
RateChangeDatedatetimeNononeNoDate the change in pay is effective
Ratemoney19,4NononeNoSalary hourly rate.
PayFrequencytinyint3,0NononeNo1 = Salary received monthly, 2 = Salary received biweekly
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on EmployeePayHistory
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
PK_EmployeePayHistory_EmployeeID_RateChangeDateClustered index created by a primary key constraint.YesYesCLUSTEREDEmployeeID, RateChangeDate
Foreign Keys in EmployeePayHistory
Foreign Key NameColumnsReferences Table (Columns)Description
FK_EmployeePayHistory_Employee_EmployeeIDEmployeeIDHumanResources.Employee (EmployeeID)Foreign key constraint referencing Employee.EmployeeID.

HumanResources.JobCandidate (table)

Résumés submitted to Human Resources by job applicants.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
JobCandidateIDint (identity)10,0NononeNoPrimary key for JobCandidate records.
EmployeeIDint10,0YesnoneNoEmployee identification number if applicant was hired. Foreign key to Employee.EmployeeID.
ResumexmlYesnoneNoRésumé in XML format.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on JobCandidate
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
IX_JobCandidate_EmployeeIDNonclustered index.NoNoNONCLUSTEREDEmployeeID
PK_JobCandidate_JobCandidateIDClustered index created by a primary key constraint.YesYesCLUSTEREDJobCandidateID
Foreign Keys in JobCandidate
Foreign Key NameColumnsReferences Table (Columns)Description
FK_JobCandidate_Employee_EmployeeIDEmployeeIDHumanResources.Employee (EmployeeID)Foreign key constraint referencing Employee.EmployeeID.

HumanResources.Shift (table)

Work shift lookup table.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
ShiftIDtinyint (identity)3,0NononeNoPrimary key for Shift records.
Namenvarchar50NononeNoShift description.
StartTimedatetimeNononeNoShift start time.
EndTimedatetimeNononeNoShift end time.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on Shift
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_Shift_NameUnique nonclustered index.NoYesNONCLUSTEREDName
AK_Shift_StartTime_EndTimeUnique nonclustered index.NoYesNONCLUSTEREDStartTime, EndTime
PK_Shift_ShiftIDClustered index created by a primary key constraint.YesYesCLUSTEREDShiftID

HumanResources.vEmployee (view)

Employee names and addresses.
Column NameSystem Data TypeSizeAllow NullDefaultIs Computed
EmployeeIDint10,0NononeNo
Titlenvarchar8YesnoneNo
FirstNamenvarchar50NononeNo
MiddleNamenvarchar50YesnoneNo
LastNamenvarchar50NononeNo
Suffixnvarchar10YesnoneNo
JobTitlenvarchar50NononeNo
Phonenvarchar25YesnoneNo
EmailAddressnvarchar50YesnoneNo
EmailPromotionint10,0NononeNo
AddressLine1nvarchar60NononeNo
AddressLine2nvarchar60YesnoneNo
Citynvarchar30NononeNo
StateProvinceNamenvarchar50NononeNo
PostalCodenvarchar15NononeNo
CountryRegionNamenvarchar50NononeNo
AdditionalContactInfoxmlYesnoneNo

HumanResources.vEmployeeDepartment (view)

Returns employee name, title, and current department.
Column NameSystem Data TypeSizeAllow NullDefaultIs Computed
EmployeeIDint10,0NononeNo
Titlenvarchar8YesnoneNo
FirstNamenvarchar50NononeNo
MiddleNamenvarchar50YesnoneNo
LastNamenvarchar50NononeNo
Suffixnvarchar10YesnoneNo
JobTitlenvarchar50NononeNo
Departmentnvarchar50NononeNo
GroupNamenvarchar50NononeNo
StartDatedatetimeNononeNo

HumanResources.vEmployeeDepartmentHistory (view)

Returns employee name and current and previous departments.
Column NameSystem Data TypeSizeAllow NullDefaultIs Computed
EmployeeIDint10,0NononeNo
Titlenvarchar8YesnoneNo
FirstNamenvarchar50NononeNo
MiddleNamenvarchar50YesnoneNo
LastNamenvarchar50NononeNo
Suffixnvarchar10YesnoneNo
Shiftnvarchar50NononeNo
Departmentnvarchar50NononeNo
GroupNamenvarchar50NononeNo
StartDatedatetimeNononeNo
EndDatedatetimeYesnoneNo

HumanResources.vJobCandidate (view)

Job candidate names and resumes.
Column NameSystem Data TypeSizeAllow NullDefaultIs Computed
JobCandidateIDint (identity)10,0NononeNo
EmployeeIDint10,0YesnoneNo
Name.Prefixnvarchar30YesnoneNo
Name.Firstnvarchar30YesnoneNo
Name.Middlenvarchar30YesnoneNo
Name.Lastnvarchar30YesnoneNo
Name.Suffixnvarchar30YesnoneNo
SkillsnvarcharYesnoneNo
Addr.Typenvarchar30YesnoneNo
Addr.Loc.CountryRegionnvarchar100YesnoneNo
Addr.Loc.Statenvarchar100YesnoneNo
Addr.Loc.Citynvarchar100YesnoneNo
Addr.PostalCodenvarchar20YesnoneNo
EMailnvarcharYesnoneNo
WebSitenvarcharYesnoneNo
ModifiedDatedatetimeNononeNo

HumanResources.vJobCandidateEducation (view)

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.
Column NameSystem Data TypeSizeAllow NullDefaultIs Computed
JobCandidateIDint (identity)10,0NononeNo
Edu.LevelnvarcharYesnoneNo
Edu.StartDatedatetimeYesnoneNo
Edu.EndDatedatetimeYesnoneNo
Edu.Degreenvarchar50YesnoneNo
Edu.Majornvarchar50YesnoneNo
Edu.Minornvarchar50YesnoneNo
Edu.GPAnvarchar5YesnoneNo
Edu.GPAScalenvarchar5YesnoneNo
Edu.Schoolnvarchar100YesnoneNo
Edu.Loc.CountryRegionnvarchar100YesnoneNo
Edu.Loc.Statenvarchar100YesnoneNo
Edu.Loc.Citynvarchar100YesnoneNo

HumanResources.vJobCandidateEmployment (view)

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.
Column NameSystem Data TypeSizeAllow NullDefaultIs Computed
JobCandidateIDint (identity)10,0NononeNo
Emp.StartDatedatetimeYesnoneNo
Emp.EndDatedatetimeYesnoneNo
Emp.OrgNamenvarchar100YesnoneNo
Emp.JobTitlenvarchar100YesnoneNo
Emp.ResponsibilitynvarcharYesnoneNo
Emp.FunctionCategorynvarcharYesnoneNo
Emp.IndustryCategorynvarcharYesnoneNo
Emp.Loc.CountryRegionnvarcharYesnoneNo
Emp.Loc.StatenvarcharYesnoneNo
Emp.Loc.CitynvarcharYesnoneNo

HumanResources.uspUpdateEmployeeHireInfo (stored procedure)

Updates the Employee table and inserts a new row in the EmployeePayHistory table with the values specified in the input parameters.

Parameters
Paramater NameSystem Data TypeSizeDirectionDescription
@EmployeeIDint10,0InputInput parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a valid EmployeeID from the Employee table.
@Titlenvarchar50InputInput parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a title for the employee.
@HireDatedatetimeInputInput parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a hire date for the employee.
@RateChangeDatedatetimeInputInput parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter the date the rate changed for the employee.
@Ratemoney19,4InputInput parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter the new rate for the employee.
@PayFrequencytinyint3,0InputInput parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter the pay frequency for the employee.
@CurrentFlagbitInputInput parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter the current flag for the employee.

HumanResources.uspUpdateEmployeeLogin (stored procedure)

Updates the Employee table with the values specified in the input parameters for the given EmployeeID.

Parameters
Paramater NameSystem Data TypeSizeDirectionDescription
@EmployeeIDint10,0InputInput parameter for the stored procedure uspUpdateEmployeeLogin. Enter a valid EmployeeID from the Employee table.
@ManagerIDint10,0InputInput parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a valid ManagerID for the employee.
@LoginIDnvarchar256InputInput parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a valid login for the employee.
@Titlenvarchar50InputInput parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a title for the employee.
@HireDatedatetimeInputInput parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a hire date for the employee.
@CurrentFlagbitInputInput parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter the current flag for the employee.

HumanResources.uspUpdateEmployeePersonalInfo (stored procedure)

Updates the Employee table with the values specified in the input parameters for the given EmployeeID.

Parameters
Paramater NameSystem Data TypeSizeDirectionDescription
@EmployeeIDint10,0InputInput parameter for the stored procedure uspUpdateEmployeePersonalInfo. Enter a valid EmployeeID from the HumanResources.Employee table.
@NationalIDNumbernvarchar15InputInput parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a national ID for the employee.
@BirthDatedatetimeInputInput parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a birth date for the employee.
@MaritalStatusnchar1InputInput parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a marital status for the employee.
@Gendernchar1InputInput parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a gender for the employee.

Person (schema)

Contains objects related to names and addresses of customers, vendors, and employees

Object TypeCount
Tables6
Views2
Stored procedures0
Scalar functions0
Table functions0

Person.Address (table)

Street address information for customers, employees, and vendors.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
AddressIDint (identity)10,0NononeNoPrimary key for Address records.
AddressLine1nvarchar60NononeNoFirst street address line.
AddressLine2nvarchar60YesnoneNoSecond street address line.
Citynvarchar30NononeNoName of the city.
StateProvinceIDint10,0NononeNoUnique identification number for the state or province. Foreign key to StateProvince table.
PostalCodenvarchar15NononeNoPostal code for the street address.
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on Address
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_Address_rowguidUnique nonclustered index. Used to support replication samples.NoYesNONCLUSTEREDrowguid
IX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCodeNonclustered index.NoYesNONCLUSTEREDAddressLine1, AddressLine2, City, StateProvinceID, PostalCode
IX_Address_StateProvinceIDNonclustered index.NoNoNONCLUSTEREDStateProvinceID
PK_Address_AddressIDClustered index created by a primary key constraint.YesYesCLUSTEREDAddressID
Foreign Keys in Address
Foreign Key NameColumnsReferences Table (Columns)Description
FK_Address_StateProvince_StateProvinceIDStateProvinceIDPerson.StateProvince (StateProvinceID)Foreign key constraint referencing StateProvince.StateProvinceID.

Person.AddressType (table)

Types of addresses stored in the Address table.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
AddressTypeIDint (identity)10,0NononeNoPrimary key for AddressType records.
Namenvarchar50NononeNoAddress type description. For example, Billing, Home, or Shipping.
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on AddressType
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_AddressType_NameUnique nonclustered index.NoYesNONCLUSTEREDName
AK_AddressType_rowguidUnique nonclustered index. Used to support replication samples.NoYesNONCLUSTEREDrowguid
PK_AddressType_AddressTypeIDClustered index created by a primary key constraint.YesYesCLUSTEREDAddressTypeID

Person.Contact (table)

Names of each employee, customer contact, and vendor contact.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
ContactIDint (identity)10,0NononeNoPrimary key for Contact records.
NameStylebitNo((0))No0 = The data in FirstName and LastName are stored in western style (first name, last name) order. 1 = Eastern style (last name, first name) order.
Titlenvarchar8YesnoneNoA courtesy title. For example, Mr. or Ms.
FirstNamenvarchar50NononeNoFirst name of the person.
MiddleNamenvarchar50YesnoneNoMiddle name or middle initial of the person.
LastNamenvarchar50NononeNoLast name of the person.
Suffixnvarchar10YesnoneNoSurname suffix. For example, Sr. or Jr.
EmailAddressnvarchar50YesnoneNoE-mail address for the person.
EmailPromotionint10,0No((0))No0 = 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.
Phonenvarchar25YesnoneNoPhone number associated with the person.
PasswordHashvarchar128NononeNoPassword for the e-mail account.
PasswordSaltvarchar10NononeNoRandom value concatenated with the password string before the password is hashed.
AdditionalContactInfoxmlYesnoneNoAdditional contact information about the person stored in xml format.
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on Contact
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_Contact_rowguidUnique nonclustered index. Used to support replication samples.NoYesNONCLUSTEREDrowguid
IX_Contact_EmailAddressNonclustered index.NoNoNONCLUSTEREDEmailAddress
PK_Contact_ContactIDClustered index created by a primary key constraint.YesYesCLUSTEREDContactID
PXML_Contact_AddContactPrimary XML index.NoNoXMLAdditionalContactInfo

Person.ContactType (table)

Lookup table containing the types of contacts stored in Contact.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
ContactTypeIDint (identity)10,0NononeNoPrimary key for ContactType records.
Namenvarchar50NononeNoContact type description.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on ContactType
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_ContactType_NameUnique nonclustered index.NoYesNONCLUSTEREDName
PK_ContactType_ContactTypeIDClustered index created by a primary key constraint.YesYesCLUSTEREDContactTypeID

Person.CountryRegion (table)

Lookup table containing the ISO standard codes for countries and regions.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
CountryRegionCodenvarchar3NononeNoISO standard code for countries and regions.
Namenvarchar50NononeNoCountry or region name.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on CountryRegion
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_CountryRegion_NameUnique nonclustered index.NoYesNONCLUSTEREDName
PK_CountryRegion_CountryRegionCodeClustered index created by a primary key constraint.YesYesCLUSTEREDCountryRegionCode

Person.StateProvince (table)

State and province lookup table.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
StateProvinceIDint (identity)10,0NononeNoPrimary key for StateProvince records.
StateProvinceCodenchar3NononeNoISO standard state or province code.
CountryRegionCodenvarchar3NononeNoISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode.
IsOnlyStateProvinceFlagbitNo((1))No0 = StateProvinceCode exists. 1 = StateProvinceCode unavailable, using CountryRegionCode.
Namenvarchar50NononeNoState or province description.
TerritoryIDint10,0NononeNoID of the territory in which the state or province is located. Foreign key to SalesTerritory.SalesTerritoryID.
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on StateProvince
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_StateProvince_NameUnique nonclustered index.NoYesNONCLUSTEREDName
AK_StateProvince_rowguidUnique nonclustered index. Used to support replication samples.NoYesNONCLUSTEREDrowguid
AK_StateProvince_StateProvinceCode_CountryRegionCodeUnique nonclustered index.NoYesNONCLUSTEREDStateProvinceCode, CountryRegionCode
PK_StateProvince_StateProvinceIDClustered index created by a primary key constraint.YesYesCLUSTEREDStateProvinceID
Foreign Keys in StateProvince
Foreign Key NameColumnsReferences Table (Columns)Description
FK_StateProvince_CountryRegion_CountryRegionCodeCountryRegionCodePerson.CountryRegion (CountryRegionCode)Foreign key constraint referencing CountryRegion.CountryRegionCode.
FK_StateProvince_SalesTerritory_TerritoryIDTerritoryIDSales.SalesTerritory (TerritoryID)Foreign key constraint referencing SalesTerritory.TerritoryID.

Person.vAdditionalContactInfo (view)

Displays the contact name and content from each element in the xml column AdditionalContactInfo for that person.
Column NameSystem Data TypeSizeAllow NullDefaultIs Computed
ContactIDint (identity)10,0NononeNo
FirstNamenvarchar50NononeNo
MiddleNamenvarchar50YesnoneNo
LastNamenvarchar50NononeNo
TelephoneNumbernvarchar50YesnoneNo
TelephoneSpecialInstructionsnvarcharYesnoneNo
Streetnvarchar50YesnoneNo
Citynvarchar50YesnoneNo
StateProvincenvarchar50YesnoneNo
PostalCodenvarchar50YesnoneNo
CountryRegionnvarchar50YesnoneNo
HomeAddressSpecialInstructionsnvarcharYesnoneNo
EMailAddressnvarchar128YesnoneNo
EMailSpecialInstructionsnvarcharYesnoneNo
EMailTelephoneNumbernvarchar50YesnoneNo
rowguiduniqueidentifierNononeNo
ModifiedDatedatetimeNononeNo

Person.vStateProvinceCountryRegion (view)

Joins StateProvince table with CountryRegion table.
Column NameSystem Data TypeSizeAllow NullDefaultIs Computed
StateProvinceIDint10,0NononeNo
StateProvinceCodenchar3NononeNo
IsOnlyStateProvinceFlagbitNononeNo
StateProvinceNamenvarchar50NononeNo
TerritoryIDint10,0NononeNo
CountryRegionCodenvarchar3NononeNo
CountryRegionNamenvarchar50NononeNo
Indexes on vStateProvinceCountryRegion
Index NameDescriptionIs UniqueIndex TypeColumns
IX_vStateProvinceCountryRegionClustered index on the view vStateProvinceCountryRegion.YesCLUSTEREDStateProvinceID, CountryRegionCode

Production (schema)

Contains objects related to products, inventory, and manufacturing.

Object TypeCount
Tables25
Views3
Stored procedures0
Scalar functions0
Table functions0

Production.BillOfMaterials (table)

Items required to make bicycles and bicycle subassemblies. It identifies the heirarchical relationship between a parent product and its components.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
BillOfMaterialsIDint (identity)10,0NononeNoPrimary key for BillOfMaterials records.
ProductAssemblyIDint10,0YesnoneNoParent product identification number. Foreign key to Product.ProductID.
ComponentIDint10,0NononeNoComponent identification number. Foreign key to Product.ProductID.
StartDatedatetimeNo(getdate())NoDate the component started being used in the assembly item.
EndDatedatetimeYesnoneNoDate the component stopped being used in the assembly item.
UnitMeasureCodenchar3NononeNoStandard code identifying the unit of measure for the quantity.
BOMLevelsmallint5,0NononeNoIndicates the depth the component is from its parent (AssemblyID).
PerAssemblyQtydecimal8,2No((1.00))NoQuantity of the component needed to create the assembly.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on BillOfMaterials
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_BillOfMaterials_ProductAssemblyID_ComponentID_StartDateClustered index.NoYesCLUSTEREDProductAssemblyID, ComponentID, StartDate
IX_BillOfMaterials_UnitMeasureCodeNonclustered index.NoNoNONCLUSTEREDUnitMeasureCode
PK_BillOfMaterials_BillOfMaterialsIDNonclustered index created by a primary key constraint.YesYesNONCLUSTEREDBillOfMaterialsID
Foreign Keys in BillOfMaterials
Foreign Key NameColumnsReferences Table (Columns)Description
FK_BillOfMaterials_Product_ComponentIDComponentIDProduction.Product (ProductID)Foreign key constraint referencing Product.ComponentID.
FK_BillOfMaterials_Product_ProductAssemblyIDProductAssemblyIDProduction.Product (ProductID)Foreign key constraint referencing Product.ProductAssemblyID.
FK_BillOfMaterials_UnitMeasure_UnitMeasureCodeUnitMeasureCodeProduction.UnitMeasure (UnitMeasureCode)Foreign key constraint referencing UnitMeasure.UnitMeasureCode.

Production.Culture (table)

Lookup table containing the languages in which some AdventureWorks data is stored.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
CultureIDnchar6NononeNoPrimary key for Culture records.
Namenvarchar50NononeNoCulture description.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on Culture
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_Culture_NameUnique nonclustered index.NoYesNONCLUSTEREDName
PK_Culture_CultureIDClustered index created by a primary key constraint.YesYesCLUSTEREDCultureID

Production.Document (table)

Product maintenance documents.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
DocumentIDint (identity)10,0NononeNoPrimary key for Document records.
Titlenvarchar50NononeNoTitle of the document.
FileNamenvarchar400NononeNoDirectory path and file name of the document
FileExtensionnvarchar8NononeNoFile extension indicating the document type. For example, .doc or .txt.
Revisionnchar5NononeNoRevision number of the document.
ChangeNumberint10,0No((0))NoEngineering change approval number.
Statustinyint3,0NononeNo1 = Pending approval, 2 = Approved, 3 = Obsolete
DocumentSummarynvarcharYesnoneNoDocument abstract.
DocumentvarbinaryYesnoneNoComplete document.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on Document
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_Document_FileName_RevisionUnique nonclustered index.NoYesNONCLUSTEREDFileName, Revision
PK_Document_DocumentIDClustered index created by a primary key constraint.YesYesCLUSTEREDDocumentID

Production.Illustration (table)

Bicycle assembly diagrams.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
IllustrationIDint (identity)10,0NononeNoPrimary key for Illustration records.
DiagramxmlYesnoneNoIllustrations used in manufacturing instructions. Stored as XML.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on Illustration
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
PK_Illustration_IllustrationIDClustered index created by a primary key constraint.YesYesCLUSTEREDIllustrationID

Production.Location (table)

Product inventory and manufacturing locations.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
LocationIDsmallint (identity)5,0NononeNoPrimary key for Location records.
Namenvarchar50NononeNoLocation description.
CostRatesmallmoney10,4No((0.00))NoStandard hourly cost of the manufacturing location.
Availabilitydecimal8,2No((0.00))NoWork capacity (in hours) of the manufacturing location.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on Location
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_Location_NameUnique nonclustered index.NoYesNONCLUSTEREDName
PK_Location_LocationIDClustered index created by a primary key constraint.YesYesCLUSTEREDLocationID

Production.Product (table)

Products sold or used in the manfacturing of sold products.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
ProductIDint (identity)10,0NononeNoPrimary key for Product records.
Namenvarchar50NononeNoName of the product.
ProductNumbernvarchar25NononeNoUnique product identification number.
MakeFlagbitNo((1))No0 = Product is purchased, 1 = Product is manufactured in-house.
FinishedGoodsFlagbitNo((1))No0 = Product is not a salable item. 1 = Product is salable.
Colornvarchar15YesnoneNoProduct color.
SafetyStockLevelsmallint5,0NononeNoMinimum inventory quantity.
ReorderPointsmallint5,0NononeNoInventory level that triggers a purchase order or work order.
StandardCostmoney19,4NononeNoStandard cost of the product.
ListPricemoney19,4NononeNoSelling price.
Sizenvarchar5YesnoneNoProduct size.
SizeUnitMeasureCodenchar3YesnoneNoUnit of measure for Size column.
WeightUnitMeasureCodenchar3YesnoneNoUnit of measure for Weight column.
Weightdecimal8,2YesnoneNoProduct weight.
DaysToManufactureint10,0NononeNoNumber of days required to manufacture the product.
ProductLinenchar2YesnoneNoR = Road, M = Mountain, T = Touring, S = Standard
Classnchar2YesnoneNoH = High, M = Medium, L = Low
Stylenchar2YesnoneNoW = Womens, M = Mens, U = Universal
ProductSubcategoryIDint10,0YesnoneNoProduct is a member of this product subcategory. Foreign key to ProductSubCategory.ProductSubCategoryID.
ProductModelIDint10,0YesnoneNoProduct is a member of this product model. Foreign key to ProductModel.ProductModelID.
SellStartDatedatetimeNononeNoDate the product was available for sale.
SellEndDatedatetimeYesnoneNoDate the product was no longer available for sale.
DiscontinuedDatedatetimeYesnoneNoDate the product was discontinued.
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on Product
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_Product_NameUnique nonclustered index.NoYesNONCLUSTEREDName
AK_Product_ProductNumberUnique nonclustered index.NoYesNONCLUSTEREDProductNumber
AK_Product_rowguidUnique nonclustered index. Used to support replication samples.NoYesNONCLUSTEREDrowguid
PK_Product_ProductIDClustered index created by a primary key constraint.YesYesCLUSTEREDProductID
Foreign Keys in Product
Foreign Key NameColumnsReferences Table (Columns)Description
FK_Product_ProductModel_ProductModelIDProductModelIDProduction.ProductModel (ProductModelID)Foreign key constraint referencing ProductModel.ProductModelID.
FK_Product_ProductSubcategory_ProductSubcategoryIDProductSubcategoryIDProduction.ProductSubcategory (ProductSubcategoryID)Foreign key constraint referencing ProductSubcategory.ProductSubcategoryID.
FK_Product_UnitMeasure_SizeUnitMeasureCodeSizeUnitMeasureCodeProduction.UnitMeasure (UnitMeasureCode)Foreign key constraint referencing UnitMeasure.UnitMeasureCode.
FK_Product_UnitMeasure_WeightUnitMeasureCodeWeightUnitMeasureCodeProduction.UnitMeasure (UnitMeasureCode)Foreign key constraint referencing UnitMeasure.UnitMeasureCode.

Production.ProductCategory (table)

High-level product categorization.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
ProductCategoryIDint (identity)10,0NononeNoPrimary key for ProductCategory records.
Namenvarchar50NononeNoCategory description.
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on ProductCategory
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_ProductCategory_NameUnique nonclustered index.NoYesNONCLUSTEREDName
AK_ProductCategory_rowguidUnique nonclustered index. Used to support replication samples.NoYesNONCLUSTEREDrowguid
PK_ProductCategory_ProductCategoryIDClustered index created by a primary key constraint.YesYesCLUSTEREDProductCategoryID

Production.ProductCostHistory (table)

Changes in the cost of a product over time.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
ProductIDint10,0NononeNoProduct identification number. Foreign key to Product.ProductID
StartDatedatetimeNononeNoProduct cost start date.
EndDatedatetimeYesnoneNoProduct cost end date.
StandardCostmoney19,4NononeNoStandard cost of the product.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on ProductCostHistory
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
PK_ProductCostHistory_ProductID_StartDateClustered index created by a primary key constraint.YesYesCLUSTEREDProductID, StartDate
Foreign Keys in ProductCostHistory
Foreign Key NameColumnsReferences Table (Columns)Description
FK_ProductCostHistory_Product_ProductIDProductIDProduction.Product (ProductID)Foreign key constraint referencing Product.ProductID.

Production.ProductDescription (table)

Product descriptions in several languages.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
ProductDescriptionIDint (identity)10,0NononeNoPrimary key for ProductDescription records.
Descriptionnvarchar400NononeNoDescription of the product.
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on ProductDescription
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_ProductDescription_rowguidUnique nonclustered index. Used to support replication samples.NoYesNONCLUSTEREDrowguid
PK_ProductDescription_ProductDescriptionIDClustered index created by a primary key constraint.YesYesCLUSTEREDProductDescriptionID

Production.ProductDocument (table)

Cross-reference table mapping products to related product documents.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
ProductIDint10,0NononeNoProduct identification number. Foreign key to Product.ProductID.
DocumentIDint10,0NononeNoDocument identification number. Foreign key to Document.DocumentID.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on ProductDocument
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
PK_ProductDocument_ProductID_DocumentIDClustered index created by a primary key constraint.YesYesCLUSTEREDProductID, DocumentID
Foreign Keys in ProductDocument
Foreign Key NameColumnsReferences Table (Columns)Description
FK_ProductDocument_Document_DocumentIDDocumentIDProduction.Document (DocumentID)Foreign key constraint referencing Document.DocumentID.
FK_ProductDocument_Product_ProductIDProductIDProduction.Product (ProductID)Foreign key constraint referencing Product.ProductID.

Production.ProductInventory (table)

Product inventory information.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
ProductIDint10,0NononeNoProduct identification number. Foreign key to Product.ProductID.
LocationIDsmallint5,0NononeNoInventory location identification number. Foreign key to Location.LocationID.
Shelfnvarchar10NononeNoStorage compartment within an inventory location.
Bintinyint3,0NononeNoStorage container on a shelf in an inventory location.
Quantitysmallint5,0No((0))NoQuantity of products in the inventory location.
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on ProductInventory
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
PK_ProductInventory_ProductID_LocationIDClustered index created by a primary key constraint.YesYesCLUSTEREDProductID, LocationID
Foreign Keys in ProductInventory
Foreign Key NameColumnsReferences Table (Columns)Description
FK_ProductInventory_Location_LocationIDLocationIDProduction.Location (LocationID)Foreign key constraint referencing Location.LocationID.
FK_ProductInventory_Product_ProductIDProductIDProduction.Product (ProductID)Foreign key constraint referencing Product.ProductID.

Production.ProductListPriceHistory (table)

Changes in the list price of a product over time.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
ProductIDint10,0NononeNoProduct identification number. Foreign key to Product.ProductID
StartDatedatetimeNononeNoList price start date.
EndDatedatetimeYesnoneNoList price end date
ListPricemoney19,4NononeNoProduct list price.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on ProductListPriceHistory
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
PK_ProductListPriceHistory_ProductID_StartDateClustered index created by a primary key constraint.YesYesCLUSTEREDProductID, StartDate
Foreign Keys in ProductListPriceHistory
Foreign Key NameColumnsReferences Table (Columns)Description
FK_ProductListPriceHistory_Product_ProductIDProductIDProduction.Product (ProductID)Foreign key constraint referencing Product.ProductID.

Production.ProductModel (table)

Product model classification.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
ProductModelIDint (identity)10,0NononeNoPrimary key for ProductModel records.
Namenvarchar50NononeNoProduct model description.
CatalogDescriptionxmlYesnoneNoDetailed product catalog information in xml format.
InstructionsxmlYesnoneNoManufacturing instructions in xml format.
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on ProductModel
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_ProductModel_NameUnique nonclustered index.NoYesNONCLUSTEREDName
AK_ProductModel_rowguidUnique nonclustered index. Used to support replication samples.NoYesNONCLUSTEREDrowguid
PK_ProductModel_ProductModelIDClustered index created by a primary key constraint.YesYesCLUSTEREDProductModelID
PXML_ProductModel_CatalogDescriptionPrimary XML index.NoNoXMLCatalogDescription
PXML_ProductModel_InstructionsPrimary XML index.NoNoXMLInstructions

Production.ProductModelIllustration (table)

Cross-reference table mapping product models and illustrations.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
ProductModelIDint10,0NononeNoPrimary key. Foreign key to ProductModel.ProductModelID.
IllustrationIDint10,0NononeNoPrimary key. Foreign key to Illustration.IllustrationID.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on ProductModelIllustration
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
PK_ProductModelIllustration_ProductModelID_IllustrationIDClustered index created by a primary key constraint.YesYesCLUSTEREDProductModelID, IllustrationID
Foreign Keys in ProductModelIllustration
Foreign Key NameColumnsReferences Table (Columns)Description
FK_ProductModelIllustration_Illustration_IllustrationIDIllustrationIDProduction.Illustration (IllustrationID)Foreign key constraint referencing Illustration.IllustrationID.
FK_ProductModelIllustration_ProductModel_ProductModelIDProductModelIDProduction.ProductModel (ProductModelID)Foreign key constraint referencing ProductModel.ProductModelID.

Production.ProductModelProductDescriptionCulture (table)

Cross-reference table mapping product descriptions and the language the description is written in.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
ProductModelIDint10,0NononeNoPrimary key. Foreign key to ProductModel.ProductModelID.
ProductDescriptionIDint10,0NononeNoPrimary key. Foreign key to ProductDescription.ProductDescriptionID.
CultureIDnchar6NononeNoCulture identification number. Foreign key to Culture.CultureID.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on ProductModelProductDescriptionCulture
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
PK_ProductModelProductDescriptionCulture_ProductModelID_ProductDescriptionID_CultureIDClustered index created by a primary key constraint.YesYesCLUSTEREDProductModelID, ProductDescriptionID, CultureID
Foreign Keys in ProductModelProductDescriptionCulture
Foreign Key NameColumnsReferences Table (Columns)Description
FK_ProductModelProductDescriptionCulture_Culture_CultureIDCultureIDProduction.Culture (CultureID)Foreign key constraint referencing Culture.CultureID.
FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionIDProductDescriptionIDProduction.ProductDescription (ProductDescriptionID)Foreign key constraint referencing ProductDescription.ProductDescriptionID.
FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelIDProductModelIDProduction.ProductModel (ProductModelID)Foreign key constraint referencing ProductModel.ProductModelID.

Production.ProductPhoto (table)

Product images.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
ProductPhotoIDint (identity)10,0NononeNoPrimary key for ProductPhoto records.
ThumbNailPhotovarbinaryYesnoneNoSmall image of the product.
ThumbnailPhotoFileNamenvarchar50YesnoneNoSmall image file name.
LargePhotovarbinaryYesnoneNoLarge image of the product.
LargePhotoFileNamenvarchar50YesnoneNoLarge image file name.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on ProductPhoto
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
PK_ProductPhoto_ProductPhotoIDClustered index created by a primary key constraint.YesYesCLUSTEREDProductPhotoID

Production.ProductProductPhoto (table)

Cross-reference table mapping products and product photos.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
ProductIDint10,0NononeNoProduct identification number. Foreign key to Product.ProductID.
ProductPhotoIDint10,0NononeNoProduct photo identification number. Foreign key to ProductPhoto.ProductPhotoID.
PrimarybitNo((0))No0 = Photo is not the principal image. 1 = Photo is the principal image.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on ProductProductPhoto
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
PK_ProductProductPhoto_ProductID_ProductPhotoIDNonclustered index created by a primary key constraint.YesYesNONCLUSTEREDProductID, ProductPhotoID
Foreign Keys in ProductProductPhoto
Foreign Key NameColumnsReferences Table (Columns)Description
FK_ProductProductPhoto_Product_ProductIDProductIDProduction.Product (ProductID)Foreign key constraint referencing Product.ProductID.
FK_ProductProductPhoto_ProductPhoto_ProductPhotoIDProductPhotoIDProduction.ProductPhoto (ProductPhotoID)Foreign key constraint referencing ProductPhoto.ProductPhotoID.

Production.ProductReview (table)

Customer reviews of products they have purchased.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
ProductReviewIDint (identity)10,0NononeNoPrimary key for ProductReview records.
ProductIDint10,0NononeNoProduct identification number. Foreign key to Product.ProductID.
ReviewerNamenvarchar50NononeNoName of the reviewer.
ReviewDatedatetimeNo(getdate())NoDate review was submitted.
EmailAddressnvarchar50NononeNoReviewer's e-mail address.
Ratingint10,0NononeNoProduct rating given by the reviewer. Scale is 1 to 5 with 5 as the highest rating.
Commentsnvarchar3850YesnoneNoReviewer's comments
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on ProductReview
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
IX_ProductReview_ProductID_NameNonclustered index.NoNoNONCLUSTEREDComments, ProductID, ReviewerName
PK_ProductReview_ProductReviewIDClustered index created by a primary key constraint.YesYesCLUSTEREDProductReviewID
Foreign Keys in ProductReview
Foreign Key NameColumnsReferences Table (Columns)Description
FK_ProductReview_Product_ProductIDProductIDProduction.Product (ProductID)Foreign key constraint referencing Product.ProductID.

Production.ProductSubcategory (table)

Product subcategories. See ProductCategory table.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
ProductSubcategoryIDint (identity)10,0NononeNoPrimary key for ProductSubcategory records.
ProductCategoryIDint10,0NononeNoProduct category identification number. Foreign key to ProductCategory.ProductCategoryID.
Namenvarchar50NononeNoSubcategory description.
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on ProductSubcategory
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_ProductSubcategory_NameUnique nonclustered index.NoYesNONCLUSTEREDName
AK_ProductSubcategory_rowguidUnique nonclustered index. Used to support replication samples.NoYesNONCLUSTEREDrowguid
PK_ProductSubcategory_ProductSubcategoryIDClustered index created by a primary key constraint.YesYesCLUSTEREDProductSubcategoryID
Foreign Keys in ProductSubcategory
Foreign Key NameColumnsReferences Table (Columns)Description
FK_ProductSubcategory_ProductCategory_ProductCategoryIDProductCategoryIDProduction.ProductCategory (ProductCategoryID)Foreign key constraint referencing ProductCategory.ProductCategoryID.

Production.ScrapReason (table)

Manufacturing failure reasons lookup table.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
ScrapReasonIDsmallint (identity)5,0NononeNoPrimary key for ScrapReason records.
Namenvarchar50NononeNoFailure description.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on ScrapReason
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_ScrapReason_NameUnique nonclustered index.NoYesNONCLUSTEREDName
PK_ScrapReason_ScrapReasonIDClustered index created by a primary key constraint.YesYesCLUSTEREDScrapReasonID

Production.TransactionHistory (table)

Record of each purchase order, sales order, or work order transaction year to date.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
TransactionIDint (identity)10,0NononeNoPrimary key for TransactionHistory records.
ProductIDint10,0NononeNoProduct identification number. Foreign key to Product.ProductID.
ReferenceOrderIDint10,0NononeNoPurchase order, sales order, or work order identification number.
ReferenceOrderLineIDint10,0No((0))NoLine number associated with the purchase order, sales order, or work order.
TransactionDatedatetimeNo(getdate())NoDate and time of the transaction.
TransactionTypenchar1NononeNoW = WorkOrder, S = SalesOrder, P = PurchaseOrder
Quantityint10,0NononeNoProduct quantity.
ActualCostmoney19,4NononeNoProduct cost.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on TransactionHistory
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
IX_TransactionHistory_ProductIDNonclustered index.NoNoNONCLUSTEREDProductID
IX_TransactionHistory_ReferenceOrderID_ReferenceOrderLineIDNonclustered index.NoNoNONCLUSTEREDReferenceOrderID, ReferenceOrderLineID
PK_TransactionHistory_TransactionIDClustered index created by a primary key constraint.YesYesCLUSTEREDTransactionID
Foreign Keys in TransactionHistory
Foreign Key NameColumnsReferences Table (Columns)Description
FK_TransactionHistory_Product_ProductIDProductIDProduction.Product (ProductID)Foreign key constraint referencing Product.ProductID.

Production.TransactionHistoryArchive (table)

Transactions for previous years.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
TransactionIDint10,0NononeNoPrimary key for TransactionHistoryArchive records.
ProductIDint10,0NononeNoProduct identification number. Foreign key to Product.ProductID.
ReferenceOrderIDint10,0NononeNoPurchase order, sales order, or work order identification number.
ReferenceOrderLineIDint10,0No((0))NoLine number associated with the purchase order, sales order, or work order.
TransactionDatedatetimeNo(getdate())NoDate and time of the transaction.
TransactionTypenchar1NononeNoW = Work Order, S = Sales Order, P = Purchase Order
Quantityint10,0NononeNoProduct quantity.
ActualCostmoney19,4NononeNoProduct cost.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on TransactionHistoryArchive
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
IX_TransactionHistoryArchive_ProductIDNonclustered index.NoNoNONCLUSTEREDProductID
IX_TransactionHistoryArchive_ReferenceOrderID_ReferenceOrderLineIDNonclustered index.NoNoNONCLUSTEREDReferenceOrderID, ReferenceOrderLineID
PK_TransactionHistoryArchive_TransactionIDClustered index created by a primary key constraint.YesYesCLUSTEREDTransactionID

Production.UnitMeasure (table)

Unit of measure lookup table.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
UnitMeasureCodenchar3NononeNoPrimary key.
Namenvarchar50NononeNoUnit of measure description.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on UnitMeasure
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_UnitMeasure_NameUnique nonclustered index.NoYesNONCLUSTEREDName
PK_UnitMeasure_UnitMeasureCodeClustered index created by a primary key constraint.YesYesCLUSTEREDUnitMeasureCode

Production.WorkOrder (table)

Manufacturing work orders.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
WorkOrderIDint (identity)10,0NononeNoPrimary key for WorkOrder records.
ProductIDint10,0NononeNoProduct identification number. Foreign key to Product.ProductID.
OrderQtyint10,0NononeNoProduct quantity to build.
StockedQtyint10,0NononeYesQuantity built and put in inventory.
ScrappedQtysmallint5,0NononeNoQuantity that failed inspection.
StartDatedatetimeNononeNoWork order start date.
EndDatedatetimeYesnoneNoWork order end date.
DueDatedatetimeNononeNoWork order due date.
ScrapReasonIDsmallint5,0YesnoneNoReason for inspection failure.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on WorkOrder
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
IX_WorkOrder_ProductIDNonclustered index.NoNoNONCLUSTEREDProductID
IX_WorkOrder_ScrapReasonIDNonclustered index.NoNoNONCLUSTEREDScrapReasonID
PK_WorkOrder_WorkOrderIDClustered index created by a primary key constraint.YesYesCLUSTEREDWorkOrderID
Foreign Keys in WorkOrder
Foreign Key NameColumnsReferences Table (Columns)Description
FK_WorkOrder_Product_ProductIDProductIDProduction.Product (ProductID)Foreign key constraint referencing Product.ProductID.
FK_WorkOrder_ScrapReason_ScrapReasonIDScrapReasonIDProduction.ScrapReason (ScrapReasonID)Foreign key constraint referencing ScrapReason.ScrapReasonID.

Production.WorkOrderRouting (table)

Work order details.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
WorkOrderIDint10,0NononeNoPrimary key. Foreign key to WorkOrder.WorkOrderID.
ProductIDint10,0NononeNoPrimary key. Foreign key to Product.ProductID.
OperationSequencesmallint5,0NononeNoPrimary key. Indicates the manufacturing process sequence.
LocationIDsmallint5,0NononeNoManufacturing location where the part is processed. Foreign key to Location.LocationID.
ScheduledStartDatedatetimeNononeNoPlanned manufacturing start date.
ScheduledEndDatedatetimeNononeNoPlanned manufacturing end date.
ActualStartDatedatetimeYesnoneNoActual start date.
ActualEndDatedatetimeYesnoneNoActual end date.
ActualResourceHrsdecimal9,4YesnoneNoNumber of manufacturing hours used.
PlannedCostmoney19,4NononeNoEstimated manufacturing cost.
ActualCostmoney19,4YesnoneNoActual manufacturing cost.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on WorkOrderRouting
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
IX_WorkOrderRouting_ProductIDNonclustered index.NoNoNONCLUSTEREDProductID
PK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequenceClustered index created by a primary key constraint.YesYesCLUSTEREDWorkOrderID, ProductID, OperationSequence
Foreign Keys in WorkOrderRouting
Foreign Key NameColumnsReferences Table (Columns)Description
FK_WorkOrderRouting_Location_LocationIDLocationIDProduction.Location (LocationID)Foreign key constraint referencing Location.LocationID.
FK_WorkOrderRouting_WorkOrder_WorkOrderIDWorkOrderIDProduction.WorkOrder (WorkOrderID)Foreign key constraint referencing WorkOrder.WorkOrderID.

Production.vProductAndDescription (view)

Product names and descriptions. Product descriptions are provided in multiple languages.
Column NameSystem Data TypeSizeAllow NullDefaultIs Computed
ProductIDint10,0NononeNo
Namenvarchar50NononeNo
ProductModelnvarchar50NononeNo
CultureIDnchar6NononeNo
Descriptionnvarchar400NononeNo
Indexes on vProductAndDescription
Index NameDescriptionIs UniqueIndex TypeColumns
IX_vProductAndDescriptionClustered index on the view vProductAndDescription.YesCLUSTEREDCultureID, ProductID

Production.vProductModelCatalogDescription (view)

Displays the content from each element in the xml column CatalogDescription for each product in the Production.ProductModel table that has catalog data.
Column NameSystem Data TypeSizeAllow NullDefaultIs Computed
ProductModelIDint (identity)10,0NononeNo
Namenvarchar50NononeNo
SummarynvarcharYesnoneNo
ManufacturernvarcharYesnoneNo
Copyrightnvarchar30YesnoneNo
ProductURLnvarchar256YesnoneNo
WarrantyPeriodnvarchar256YesnoneNo
WarrantyDescriptionnvarchar256YesnoneNo
NoOfYearsnvarchar256YesnoneNo
MaintenanceDescriptionnvarchar256YesnoneNo
Wheelnvarchar256YesnoneNo
Saddlenvarchar256YesnoneNo
Pedalnvarchar256YesnoneNo
BikeFramenvarcharYesnoneNo
Cranksetnvarchar256YesnoneNo
PictureAnglenvarchar256YesnoneNo
PictureSizenvarchar256YesnoneNo
ProductPhotoIDnvarchar256YesnoneNo
Materialnvarchar256YesnoneNo
Colornvarchar256YesnoneNo
ProductLinenvarchar256YesnoneNo
Stylenvarchar256YesnoneNo
RiderExperiencenvarchar1024YesnoneNo
rowguiduniqueidentifierNononeNo
ModifiedDatedatetimeNononeNo

Production.vProductModelInstructions (view)

Displays the content from each element in the xml column Instructions for each product in the Production.ProductModel table that has manufacturing instructions.
Column NameSystem Data TypeSizeAllow NullDefaultIs Computed
ProductModelIDint (identity)10,0NononeNo
Namenvarchar50NononeNo
InstructionsnvarcharYesnoneNo
LocationIDint10,0YesnoneNo
SetupHoursdecimal9,4YesnoneNo
MachineHoursdecimal9,4YesnoneNo
LaborHoursdecimal9,4YesnoneNo
LotSizeint10,0YesnoneNo
Stepnvarchar1024YesnoneNo
rowguiduniqueidentifierNononeNo
ModifiedDatedatetimeNononeNo

Purchasing (schema)

Contains objects related to vendors and purchase orders.

Object TypeCount
Tables7
Views1
Stored procedures0
Scalar functions0
Table functions0

Purchasing.ProductVendor (table)

Cross-reference table mapping vendors with the products they supply.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
ProductIDint10,0NononeNoPrimary key. Foreign key to Product.ProductID.
VendorIDint10,0NononeNoPrimary key. Foreign key to Vendor.VendorID.
AverageLeadTimeint10,0NononeNoThe average span of time (in days) between placing an order with the vendor and receiving the purchased product.
StandardPricemoney19,4NononeNoThe vendor's usual selling price.
LastReceiptCostmoney19,4YesnoneNoThe selling price when last purchased.
LastReceiptDatedatetimeYesnoneNoDate the product was last received by the vendor.
MinOrderQtyint10,0NononeNoThe maximum quantity that should be ordered.
MaxOrderQtyint10,0NononeNoThe minimum quantity that should be ordered.
OnOrderQtyint10,0YesnoneNoThe quantity currently on order.
UnitMeasureCodenchar3NononeNoThe product's unit of measure.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on ProductVendor
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
IX_ProductVendor_UnitMeasureCodeNonclustered index.NoNoNONCLUSTEREDUnitMeasureCode
IX_ProductVendor_VendorIDNonclustered index.NoNoNONCLUSTEREDVendorID
PK_ProductVendor_ProductID_VendorIDClustered index created by a primary key constraint.YesYesCLUSTEREDProductID, VendorID
Foreign Keys in ProductVendor
Foreign Key NameColumnsReferences Table (Columns)Description
FK_ProductVendor_Product_ProductIDProductIDProduction.Product (ProductID)Foreign key constraint referencing Product.ProductID.
FK_ProductVendor_UnitMeasure_UnitMeasureCodeUnitMeasureCodeProduction.UnitMeasure (UnitMeasureCode)Foreign key constraint referencing UnitMeasure.UnitMeasureCode.
FK_ProductVendor_Vendor_VendorIDVendorIDPurchasing.Vendor (VendorID)Foreign key constraint referencing Vendor.VendorID.

Purchasing.PurchaseOrderDetail (table)

Individual products associated with a specific purchase order. See PurchaseOrderHeader.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
PurchaseOrderIDint10,0NononeNoPrimary key. Foreign key to PurchaseOrderHeader.PurchaseOrderID.
PurchaseOrderDetailIDint (identity)10,0NononeNoPrimary key. One line number per purchased product.
DueDatedatetimeNononeNoDate the product is expected to be received.
OrderQtysmallint5,0NononeNoQuantity ordered.
ProductIDint10,0NononeNoProduct identification number. Foreign key to Product.ProductID.
UnitPricemoney19,4NononeNoVendor's selling price of a single product.
LineTotalmoney19,4NononeYesPer product subtotal. Computed as OrderQty * UnitPrice.
ReceivedQtydecimal8,2NononeNoQuantity actually received from the vendor.
RejectedQtydecimal8,2NononeNoQuantity rejected during inspection.
StockedQtydecimal9,2NononeYesQuantity accepted into inventory. Computed as ReceivedQty - RejectedQty.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on PurchaseOrderDetail
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
IX_PurchaseOrderDetail_ProductIDNonclustered index.NoNoNONCLUSTEREDProductID
PK_PurchaseOrderDetail_PurchaseOrderID_PurchaseOrderDetailIDClustered index created by a primary key constraint.YesYesCLUSTEREDPurchaseOrderID, PurchaseOrderDetailID
Foreign Keys in PurchaseOrderDetail
Foreign Key NameColumnsReferences Table (Columns)Description
FK_PurchaseOrderDetail_Product_ProductIDProductIDProduction.Product (ProductID)Foreign key constraint referencing Product.ProductID.
FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderIDPurchaseOrderIDPurchasing.PurchaseOrderHeader (PurchaseOrderID)Foreign key constraint referencing PurchaseOrderHeader.PurchaseOrderID.

Purchasing.PurchaseOrderHeader (table)

General purchase order information. See PurchaseOrderDetail.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
PurchaseOrderIDint (identity)10,0NononeNoPrimary key.
RevisionNumbertinyint3,0No((0))NoIncremental number to track changes to the purchase order over time.
Statustinyint3,0No((1))NoOrder current status. 1 = Pending; 2 = Approved; 3 = Rejected; 4 = Complete
EmployeeIDint10,0NononeNoEmployee who created the purchase order. Foreign key to Employee.EmployeeID.
VendorIDint10,0NononeNoVendor with whom the purchase order is placed. Foreign key to Vendor.VendorID.
ShipMethodIDint10,0NononeNoShipping method. Foreign key to ShipMethod.ShipMethodID.
OrderDatedatetimeNo(getdate())NoPurchase order creation date.
ShipDatedatetimeYesnoneNoEstimated shipment date from the vendor.
SubTotalmoney19,4No((0.00))NoPurchase order subtotal. Computed as SUM(PurchaseOrderDetail.LineTotal)for the appropriate PurchaseOrderID.
TaxAmtmoney19,4No((0.00))NoTax amount.
Freightmoney19,4No((0.00))NoShipping cost.
TotalDuemoney19,4NononeYesTotal due to vendor. Computed as Subtotal + TaxAmt + Freight.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on PurchaseOrderHeader
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
IX_PurchaseOrderHeader_EmployeeIDNonclustered index.NoNoNONCLUSTEREDEmployeeID
IX_PurchaseOrderHeader_VendorIDNonclustered index.NoNoNONCLUSTEREDVendorID
PK_PurchaseOrderHeader_PurchaseOrderIDClustered index created by a primary key constraint.YesYesCLUSTEREDPurchaseOrderID
Foreign Keys in PurchaseOrderHeader
Foreign Key NameColumnsReferences Table (Columns)Description
FK_PurchaseOrderHeader_Employee_EmployeeIDEmployeeIDHumanResources.Employee (EmployeeID)Foreign key constraint referencing Employee.EmployeeID.
FK_PurchaseOrderHeader_ShipMethod_ShipMethodIDShipMethodIDPurchasing.ShipMethod (ShipMethodID)Foreign key constraint referencing ShipMethod.ShipMethodID.
FK_PurchaseOrderHeader_Vendor_VendorIDVendorIDPurchasing.Vendor (VendorID)Foreign key constraint referencing Vendor.VendorID.

Purchasing.ShipMethod (table)

Shipping company lookup table.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
ShipMethodIDint (identity)10,0NononeNoPrimary key for ShipMethod records.
Namenvarchar50NononeNoShipping company name.
ShipBasemoney19,4No((0.00))NoMinimum shipping charge.
ShipRatemoney19,4No((0.00))NoShipping charge per pound.
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on ShipMethod
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_ShipMethod_NameUnique nonclustered index.NoYesNONCLUSTEREDName
AK_ShipMethod_rowguidUnique nonclustered index. Used to support replication samples.NoYesNONCLUSTEREDrowguid
PK_ShipMethod_ShipMethodIDClustered index created by a primary key constraint.YesYesCLUSTEREDShipMethodID

Purchasing.Vendor (table)

Companies from whom Adventure Works Cycles purchases parts or other goods.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
VendorIDint (identity)10,0NononeNoPrimary key for Vendor records.
AccountNumbernvarchar15NononeNoVendor account (identification) number.
Namenvarchar50NononeNoCompany name.
CreditRatingtinyint3,0NononeNo1 = Superior, 2 = Excellent, 3 = Above average, 4 = Average, 5 = Below average
PreferredVendorStatusbitNo((1))No0 = Do not use if another vendor is available. 1 = Preferred over other vendors supplying the same product.
ActiveFlagbitNo((1))No0 = Vendor no longer used. 1 = Vendor is actively used.
PurchasingWebServiceURLnvarchar1024YesnoneNoVendor URL.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on Vendor
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_Vendor_AccountNumberUnique nonclustered index.NoYesNONCLUSTEREDAccountNumber
PK_Vendor_VendorIDClustered index created by a primary key constraint.YesYesCLUSTEREDVendorID

Purchasing.VendorAddress (table)

Cross-reference mapping vendors and addresses.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
VendorIDint10,0NononeNoPrimary key. Foreign key to Vendor.VendorID.
AddressIDint10,0NononeNoPrimary key. Foreign key to Address.AddressID.
AddressTypeIDint10,0NononeNoAddress type. Foreign key to AddressType.AddressTypeID.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on VendorAddress
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
IX_VendorAddress_AddressIDNonclustered index.NoNoNONCLUSTEREDAddressID
PK_VendorAddress_VendorID_AddressIDClustered index created by a primary key constraint.YesYesCLUSTEREDVendorID, AddressID
Foreign Keys in VendorAddress
Foreign Key NameColumnsReferences Table (Columns)Description
FK_VendorAddress_Address_AddressIDAddressIDPerson.Address (AddressID)Foreign key constraint referencing Address.AddressID.
FK_VendorAddress_AddressType_AddressTypeIDAddressTypeIDPerson.AddressType (AddressTypeID)Foreign key constraint referencing AddressType.AddressTypeID.
FK_VendorAddress_Vendor_VendorIDVendorIDPurchasing.Vendor (VendorID)Foreign key constraint referencing Vendor.VendorID.

Purchasing.VendorContact (table)

Cross-reference table mapping vendors and their employees.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
VendorIDint10,0NononeNoPrimary key.
ContactIDint10,0NononeNoContact (Vendor employee) identification number. Foreign key to Contact.ContactID.
ContactTypeIDint10,0NononeNoContact type such as sales manager, or sales agent.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on VendorContact
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
IX_VendorContact_ContactIDNonclustered index.NoNoNONCLUSTEREDContactID
IX_VendorContact_ContactTypeIDNonclustered index.NoNoNONCLUSTEREDContactTypeID
PK_VendorContact_VendorID_ContactIDClustered index created by a primary key constraint.YesYesCLUSTEREDVendorID, ContactID
Foreign Keys in VendorContact
Foreign Key NameColumnsReferences Table (Columns)Description
FK_VendorContact_Contact_ContactIDContactIDPerson.Contact (ContactID)Foreign key constraint referencing Contact.ContactID.
FK_VendorContact_ContactType_ContactTypeIDContactTypeIDPerson.ContactType (ContactTypeID)Foreign key constraint referencing ContactType.ContactTypeID.
FK_VendorContact_Vendor_VendorIDVendorIDPurchasing.Vendor (VendorID)Foreign key constraint referencing Vendor.VendorID.

Purchasing.vVendor (view)

Vendor (company) names and addresses and the names of vendor employees to contact.
Column NameSystem Data TypeSizeAllow NullDefaultIs Computed
VendorIDint10,0NononeNo
Namenvarchar50NononeNo
ContactTypenvarchar50NononeNo
Titlenvarchar8YesnoneNo
FirstNamenvarchar50NononeNo
MiddleNamenvarchar50YesnoneNo
LastNamenvarchar50NononeNo
Suffixnvarchar10YesnoneNo
Phonenvarchar25YesnoneNo
EmailAddressnvarchar50YesnoneNo
EmailPromotionint10,0NononeNo
AddressLine1nvarchar60NononeNo
AddressLine2nvarchar60YesnoneNo
Citynvarchar30NononeNo
StateProvinceNamenvarchar50NononeNo
PostalCodenvarchar15NononeNo
CountryRegionNamenvarchar50NononeNo

Sales (schema)

Contains objects related to customers, sales orders, and sales territories.

Object TypeCount
Tables22
Views5
Stored procedures0
Scalar functions0
Table functions0

Sales.ContactCreditCard (table)

Cross-reference table mapping customers in the Contact table to their credit card information in the CreditCard table.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
ContactIDint10,0NononeNoCustomer identification number. Foreign key to Contact.ContactID.
CreditCardIDint10,0NononeNoCredit card identification number. Foreign key to CreditCard.CreditCardID.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on ContactCreditCard
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
PK_ContactCreditCard_ContactID_CreditCardIDClustered index created by a primary key constraint.YesYesCLUSTEREDContactID, CreditCardID
Foreign Keys in ContactCreditCard
Foreign Key NameColumnsReferences Table (Columns)Description
FK_ContactCreditCard_Contact_ContactIDContactIDPerson.Contact (ContactID)Foreign key constraint referencing Contact.ContactID.
FK_ContactCreditCard_CreditCard_CreditCardIDCreditCardIDSales.CreditCard (CreditCardID)Foreign key constraint referencing CreditCard.CreditCardID.

Sales.CountryRegionCurrency (table)

Cross-reference table mapping ISO currency codes to a country or region.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
CountryRegionCodenvarchar3NononeNoISO code for countries and regions. Foreign key to CountryRegion.CountryRegionCode.
CurrencyCodenchar3NononeNoISO standard currency code. Foreign key to Currency.CurrencyCode.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on CountryRegionCurrency
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
IX_CountryRegionCurrency_CurrencyCodeNonclustered index.NoNoNONCLUSTEREDCurrencyCode
PK_CountryRegionCurrency_CountryRegionCode_CurrencyCodeClustered index created by a primary key constraint.YesYesCLUSTEREDCountryRegionCode, CurrencyCode
Foreign Keys in CountryRegionCurrency
Foreign Key NameColumnsReferences Table (Columns)Description
FK_CountryRegionCurrency_CountryRegion_CountryRegionCodeCountryRegionCodePerson.CountryRegion (CountryRegionCode)Foreign key constraint referencing CountryRegion.CountryRegionCode.
FK_CountryRegionCurrency_Currency_CurrencyCodeCurrencyCodeSales.Currency (CurrencyCode)Foreign key constraint referencing Currency.CurrencyCode.

Sales.CreditCard (table)

Customer credit card information.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
CreditCardIDint (identity)10,0NononeNoPrimary key for CreditCard records.
CardTypenvarchar50NononeNoCredit card name.
CardNumbernvarchar25NononeNoCredit card number.
ExpMonthtinyint3,0NononeNoCredit card expiration month.
ExpYearsmallint5,0NononeNoCredit card expiration year.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on CreditCard
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_CreditCard_CardNumberUnique nonclustered index.NoYesNONCLUSTEREDCardNumber
PK_CreditCard_CreditCardIDClustered index created by a primary key constraint.YesYesCLUSTEREDCreditCardID

Sales.Currency (table)

Lookup table containing standard ISO currencies.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
CurrencyCodenchar3NononeNoThe ISO code for the Currency.
Namenvarchar50NononeNoCurrency name.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on Currency
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_Currency_NameUnique nonclustered index.NoYesNONCLUSTEREDName
PK_Currency_CurrencyCodeClustered index created by a primary key constraint.YesYesCLUSTEREDCurrencyCode

Sales.CurrencyRate (table)

Currency exchange rates.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
CurrencyRateIDint (identity)10,0NononeNoPrimary key for CurrencyRate records.
CurrencyRateDatedatetimeNononeNoDate and time the exchange rate was obtained.
FromCurrencyCodenchar3NononeNoExchange rate was converted from this currency code.
ToCurrencyCodenchar3NononeNoExchange rate was converted to this currency code.
AverageRatemoney19,4NononeNoAverage exchange rate for the day.
EndOfDayRatemoney19,4NononeNoFinal exchange rate for the day.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on CurrencyRate
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_CurrencyRate_CurrencyRateDate_FromCurrencyCode_ToCurrencyCodeUnique nonclustered index.NoYesNONCLUSTEREDCurrencyRateDate, FromCurrencyCode, ToCurrencyCode
PK_CurrencyRate_CurrencyRateIDClustered index created by a primary key constraint.YesYesCLUSTEREDCurrencyRateID
Foreign Keys in CurrencyRate
Foreign Key NameColumnsReferences Table (Columns)Description
FK_CurrencyRate_Currency_FromCurrencyCodeFromCurrencyCodeSales.Currency (CurrencyCode)Foreign key constraint referencing Currency.FromCurrencyCode.
FK_CurrencyRate_Currency_ToCurrencyCodeToCurrencyCodeSales.Currency (CurrencyCode)Foreign key constraint referencing Currency.ToCurrencyCode.

Sales.Customer (table)

Current customer information. Also see the Individual and Store tables.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
CustomerIDint (identity)10,0NononeNoPrimary key for Customer records.
TerritoryIDint10,0YesnoneNoID of the territory in which the customer is located. Foreign key to SalesTerritory.SalesTerritoryID.
AccountNumbervarchar10NononeYesUnique number identifying the customer assigned by the accounting system.
CustomerTypenchar1NononeNoCustomer type: I = Individual, S = Store
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on Customer
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_Customer_AccountNumberUnique nonclustered index.NoYesNONCLUSTEREDAccountNumber
AK_Customer_rowguidUnique nonclustered index. Used to support replication samples.NoYesNONCLUSTEREDrowguid
IX_Customer_TerritoryIDNonclustered index.NoNoNONCLUSTEREDTerritoryID
PK_Customer_CustomerIDClustered index created by a primary key constraint.YesYesCLUSTEREDCustomerID
Foreign Keys in Customer
Foreign Key NameColumnsReferences Table (Columns)Description
FK_Customer_SalesTerritory_TerritoryIDTerritoryIDSales.SalesTerritory (TerritoryID)Foreign key constraint referencing SalesTerritory.TerritoryID.

Sales.CustomerAddress (table)

Cross-reference table mapping customers to their address(es).
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
CustomerIDint10,0NononeNoPrimary key. Foreign key to Customer.CustomerID.
AddressIDint10,0NononeNoPrimary key. Foreign key to Address.AddressID.
AddressTypeIDint10,0NononeNoAddress type. Foreign key to AddressType.AddressTypeID.
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on CustomerAddress
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_CustomerAddress_rowguidUnique nonclustered index. Used to support replication samples.NoYesNONCLUSTEREDrowguid
PK_CustomerAddress_CustomerID_AddressIDClustered index created by a primary key constraint.YesYesCLUSTEREDCustomerID, AddressID
Foreign Keys in CustomerAddress
Foreign Key NameColumnsReferences Table (Columns)Description
FK_CustomerAddress_Address_AddressIDAddressIDPerson.Address (AddressID)Foreign key constraint referencing Address.AddressID.
FK_CustomerAddress_AddressType_AddressTypeIDAddressTypeIDPerson.AddressType (AddressTypeID)Foreign key constraint referencing AddressType.AddressTypeID.
FK_CustomerAddress_Customer_CustomerIDCustomerIDSales.Customer (CustomerID)Foreign key constraint referencing Customer.CustomerID.

Sales.Individual (table)

Demographic data about customers that purchase Adventure Works products online.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
CustomerIDint10,0NononeNoUnique customer identification number. Foreign key to Customer.CustomerID.
ContactIDint10,0NononeNoIdentifies the customer in the Contact table. Foreign key to Contact.ContactID.
DemographicsxmlYesnoneNoPersonal information such as hobbies, and income collected from online shoppers. Used for sales analysis.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on Individual
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
PK_Individual_CustomerIDClustered index created by a primary key constraint.YesYesCLUSTEREDCustomerID
PXML_Individual_DemographicsPrimary XML index.NoNoXMLDemographics
XMLPATH_Individual_DemographicsSecondary XML index for path.NoNoXMLDemographics
XMLPROPERTY_Individual_DemographicsSecondary XML index for property.NoNoXMLDemographics
XMLVALUE_Individual_DemographicsSecondary XML index for value.NoNoXMLDemographics
Foreign Keys in Individual
Foreign Key NameColumnsReferences Table (Columns)Description
FK_Individual_Contact_ContactIDContactIDPerson.Contact (ContactID)Foreign key constraint referencing Contact.ContactID.
FK_Individual_Customer_CustomerIDCustomerIDSales.Customer (CustomerID)Foreign key constraint referencing Customer.CustomerID.

Sales.SalesOrderDetail (table)

Individual products associated with a specific sales order. See SalesOrderHeader.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
SalesOrderIDint10,0NononeNoPrimary key. Foreign key to SalesOrderHeader.SalesOrderID.
SalesOrderDetailIDint (identity)10,0NononeNoPrimary key. One incremental unique number per product sold.
CarrierTrackingNumbernvarchar25YesnoneNoShipment tracking number supplied by the shipper.
OrderQtysmallint5,0NononeNoQuantity ordered per product.
ProductIDint10,0NononeNoProduct sold to customer. Foreign key to Product.ProductID.
SpecialOfferIDint10,0NononeNoPromotional code. Foreign key to SpecialOffer.SpecialOfferID.
UnitPricemoney19,4NononeNoSelling price of a single product.
UnitPriceDiscountmoney19,4No((0.0))NoDiscount amount.
LineTotalnumeric38,6NononeYesPer product subtotal. Computed as UnitPrice * (1 - UnitPriceDiscount) * OrderQty.
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on SalesOrderDetail
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_SalesOrderDetail_rowguidUnique nonclustered index. Used to support replication samples.NoYesNONCLUSTEREDrowguid
IX_SalesOrderDetail_ProductIDNonclustered index.NoNoNONCLUSTEREDProductID
PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailIDClustered index created by a primary key constraint.YesYesCLUSTEREDSalesOrderID, SalesOrderDetailID
Foreign Keys in SalesOrderDetail
Foreign Key NameColumnsReferences Table (Columns)Description
FK_SalesOrderDetail_SalesOrderHeader_SalesOrderIDSalesOrderIDSales.SalesOrderHeader (SalesOrderID)Foreign key constraint referencing SalesOrderHeader.PurchaseOrderID.
FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductIDSpecialOfferID, ProductIDSales.SpecialOfferProduct (SpecialOfferID, ProductID)Foreign key constraint referencing SpecialOfferProduct.SpecialOfferIDProductID.

Sales.SalesOrderHeader (table)

General sales order information.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
SalesOrderIDint (identity)10,0NononeNoPrimary key.
RevisionNumbertinyint3,0No((0))NoIncremental number to track changes to the sales order over time.
OrderDatedatetimeNo(getdate())NoDates the sales order was created.
DueDatedatetimeNononeNoDate the order is due to the customer.
ShipDatedatetimeYesnoneNoDate the order was shipped to the customer.
Statustinyint3,0No((1))NoOrder current status. 1 = In process; 2 = Approved; 3 = Backordered; 4 = Rejected; 5 = Shipped; 6 = Cancelled
OnlineOrderFlagbitNo((1))No0 = Order placed by sales person. 1 = Order placed online by customer.
SalesOrderNumbernvarchar25NononeYesUnique sales order identification number.
PurchaseOrderNumbernvarchar25YesnoneNoCustomer purchase order number reference.
AccountNumbernvarchar15YesnoneNoFinancial accounting number reference.
CustomerIDint10,0NononeNoCustomer identification number. Foreign key to Customer.CustomerID.
ContactIDint10,0NononeNoCustomer contact identification number. Foreign key to Contact.ContactID.
SalesPersonIDint10,0YesnoneNoSales person who created the sales order. Foreign key to SalesPerson.SalePersonID.
TerritoryIDint10,0YesnoneNoTerritory in which the sale was made. Foreign key to SalesTerritory.SalesTerritoryID.
BillToAddressIDint10,0NononeNoCustomer billing address. Foreign key to Address.AddressID.
ShipToAddressIDint10,0NononeNoCustomer shipping address. Foreign key to Address.AddressID.
ShipMethodIDint10,0NononeNoShipping method. Foreign key to ShipMethod.ShipMethodID.
CreditCardIDint10,0YesnoneNoCredit card identification number. Foreign key to CreditCard.CreditCardID.
CreditCardApprovalCodevarchar15YesnoneNoApproval code provided by the credit card company.
CurrencyRateIDint10,0YesnoneNoCurrency exchange rate used. Foreign key to CurrencyRate.CurrencyRateID.
SubTotalmoney19,4No((0.00))NoSales subtotal. Computed as SUM(SalesOrderDetail.LineTotal)for the appropriate SalesOrderID.
TaxAmtmoney19,4No((0.00))NoTax amount.
Freightmoney19,4No((0.00))NoShipping cost.
TotalDuemoney19,4NononeYesTotal due from customer. Computed as Subtotal + TaxAmt + Freight.
Commentnvarchar128YesnoneNoSales representative comments.
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on SalesOrderHeader
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_SalesOrderHeader_rowguidUnique nonclustered index. Used to support replication samples.NoYesNONCLUSTEREDrowguid
AK_SalesOrderHeader_SalesOrderNumberUnique nonclustered index.NoYesNONCLUSTEREDSalesOrderNumber
IX_SalesOrderHeader_CustomerIDNonclustered index.NoNoNONCLUSTEREDCustomerID
IX_SalesOrderHeader_SalesPersonIDNonclustered index.NoNoNONCLUSTEREDSalesPersonID
PK_SalesOrderHeader_SalesOrderIDClustered index created by a primary key constraint.YesYesCLUSTEREDSalesOrderID
Foreign Keys in SalesOrderHeader
Foreign Key NameColumnsReferences Table (Columns)Description
FK_SalesOrderHeader_Address_BillToAddressIDBillToAddressIDPerson.Address (AddressID)Foreign key constraint referencing Address.AddressID.
FK_SalesOrderHeader_Address_ShipToAddressIDShipToAddressIDPerson.Address (AddressID)Foreign key constraint referencing Address.AddressID.
FK_SalesOrderHeader_Contact_ContactIDContactIDPerson.Contact (ContactID)Foreign key constraint referencing Contact.ContactID.
FK_SalesOrderHeader_CreditCard_CreditCardIDCreditCardIDSales.CreditCard (CreditCardID)Foreign key constraint referencing CreditCard.CreditCardID.
FK_SalesOrderHeader_CurrencyRate_CurrencyRateIDCurrencyRateIDSales.CurrencyRate (CurrencyRateID)Foreign key constraint referencing CurrencyRate.CurrencyRateID.
FK_SalesOrderHeader_Customer_CustomerIDCustomerIDSales.Customer (CustomerID)Foreign key constraint referencing Customer.CustomerID.
FK_SalesOrderHeader_SalesPerson_SalesPersonIDSalesPersonIDSales.SalesPerson (SalesPersonID)Foreign key constraint referencing SalesPerson.SalesPersonID.
FK_SalesOrderHeader_SalesTerritory_TerritoryIDTerritoryIDSales.SalesTerritory (TerritoryID)Foreign key constraint referencing SalesTerritory.TerritoryID.
FK_SalesOrderHeader_ShipMethod_ShipMethodIDShipMethodIDPurchasing.ShipMethod (ShipMethodID)Foreign key constraint referencing ShipMethod.ShipMethodID.

Sales.SalesOrderHeaderSalesReason (table)

Cross-reference table mapping sales orders to sales reason codes.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
SalesOrderIDint10,0NononeNoPrimary key. Foreign key to SalesOrderHeader.SalesOrderID.
SalesReasonIDint10,0NononeNoPrimary key. Foreign key to SalesReason.SalesReasonID.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on SalesOrderHeaderSalesReason
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
PK_SalesOrderHeaderSalesReason_SalesOrderID_SalesReasonIDClustered index created by a primary key constraint.YesYesCLUSTEREDSalesOrderID, SalesReasonID
Foreign Keys in SalesOrderHeaderSalesReason
Foreign Key NameColumnsReferences Table (Columns)Description
FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderIDSalesOrderIDSales.SalesOrderHeader (SalesOrderID)Foreign key constraint referencing SalesOrderHeader.SalesOrderID.
FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonIDSalesReasonIDSales.SalesReason (SalesReasonID)Foreign key constraint referencing SalesReason.SalesReasonID.

Sales.SalesPerson (table)

Sales representative current information.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
SalesPersonIDint10,0NononeNoPrimary key for SalesPerson records.
TerritoryIDint10,0YesnoneNoTerritory currently assigned to. Foreign key to SalesTerritory.SalesTerritoryID.
SalesQuotamoney19,4YesnoneNoProjected yearly sales.
Bonusmoney19,4No((0.00))NoBonus due if quota is met.
CommissionPctsmallmoney10,4No((0.00))NoCommision percent received per sale.
SalesYTDmoney19,4No((0.00))NoSales total year to date.
SalesLastYearmoney19,4No((0.00))NoSales total of previous year.
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on SalesPerson
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_SalesPerson_rowguidUnique nonclustered index. Used to support replication samples.NoYesNONCLUSTEREDrowguid
PK_SalesPerson_SalesPersonIDClustered index created by a primary key constraint.YesYesCLUSTEREDSalesPersonID
Foreign Keys in SalesPerson
Foreign Key NameColumnsReferences Table (Columns)Description
FK_SalesPerson_Employee_SalesPersonIDSalesPersonIDHumanResources.Employee (EmployeeID)Foreign key constraint referencing Employee.EmployeeID.
FK_SalesPerson_SalesTerritory_TerritoryIDTerritoryIDSales.SalesTerritory (TerritoryID)Foreign key constraint referencing SalesTerritory.TerritoryID.

Sales.SalesPersonQuotaHistory (table)

Sales performance tracking.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
SalesPersonIDint10,0NononeNoSales person identification number. Foreign key to SalesPerson.SalesPersonID.
QuotaDatedatetimeNononeNoSales quota date.
SalesQuotamoney19,4NononeNoSales quota amount.
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on SalesPersonQuotaHistory
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_SalesPersonQuotaHistory_rowguidUnique nonclustered index. Used to support replication samples.NoYesNONCLUSTEREDrowguid
PK_SalesPersonQuotaHistory_SalesPersonID_QuotaDateClustered index created by a primary key constraint.YesYesCLUSTEREDSalesPersonID, QuotaDate
Foreign Keys in SalesPersonQuotaHistory
Foreign Key NameColumnsReferences Table (Columns)Description
FK_SalesPersonQuotaHistory_SalesPerson_SalesPersonIDSalesPersonIDSales.SalesPerson (SalesPersonID)Foreign key constraint referencing SalesPerson.SalesPersonID.

Sales.SalesReason (table)

Lookup table of customer purchase reasons.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
SalesReasonIDint (identity)10,0NononeNoPrimary key for SalesReason records.
Namenvarchar50NononeNoSales reason description.
ReasonTypenvarchar50NononeNoCategory the sales reason belongs to.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on SalesReason
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
PK_SalesReason_SalesReasonIDClustered index created by a primary key constraint.YesYesCLUSTEREDSalesReasonID

Sales.SalesTaxRate (table)

Tax rate lookup table.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
SalesTaxRateIDint (identity)10,0NononeNoPrimary key for SalesTaxRate records.
StateProvinceIDint10,0NononeNoState, province, or country/region the sales tax applies to.
TaxTypetinyint3,0NononeNo1 = Tax applied to retail transactions, 2 = Tax applied to wholesale transactions, 3 = Tax applied to all sales (retail and wholesale) transactions.
TaxRatesmallmoney10,4No((0.00))NoTax rate amount.
Namenvarchar50NononeNoTax rate description.
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on SalesTaxRate
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_SalesTaxRate_rowguidUnique nonclustered index. Used to support replication samples.NoYesNONCLUSTEREDrowguid
AK_SalesTaxRate_StateProvinceID_TaxTypeUnique nonclustered index.NoYesNONCLUSTEREDStateProvinceID, TaxType
PK_SalesTaxRate_SalesTaxRateIDClustered index created by a primary key constraint.YesYesCLUSTEREDSalesTaxRateID
Foreign Keys in SalesTaxRate
Foreign Key NameColumnsReferences Table (Columns)Description
FK_SalesTaxRate_StateProvince_StateProvinceIDStateProvinceIDPerson.StateProvince (StateProvinceID)Foreign key constraint referencing StateProvince.StateProvinceID.

Sales.SalesTerritory (table)

Sales territory lookup table.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
TerritoryIDint (identity)10,0NononeNoPrimary key for SalesTerritory records.
Namenvarchar50NononeNoSales territory description
CountryRegionCodenvarchar3NononeNoISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode.
Groupnvarchar50NononeNoGeographic area to which the sales territory belong.
SalesYTDmoney19,4No((0.00))NoSales in the territory year to date.
SalesLastYearmoney19,4No((0.00))NoSales in the territory the previous year.
CostYTDmoney19,4No((0.00))NoBusiness costs in the territory year to date.
CostLastYearmoney19,4No((0.00))NoBusiness costs in the territory the previous year.
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on SalesTerritory
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_SalesTerritory_NameUnique nonclustered index.NoYesNONCLUSTEREDName
AK_SalesTerritory_rowguidUnique nonclustered index. Used to support replication samples.NoYesNONCLUSTEREDrowguid
PK_SalesTerritory_TerritoryIDClustered index created by a primary key constraint.YesYesCLUSTEREDTerritoryID

Sales.SalesTerritoryHistory (table)

Sales representative transfers to other sales territories.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
SalesPersonIDint10,0NononeNoPrimary key for SalesTerritoryHistory records.
TerritoryIDint10,0NononeNoTerritory identification number. Foreign key to SalesTerritory.SalesTerritoryID.
StartDatedatetimeNononeNoDate the sales representive started work in the territory.
EndDatedatetimeYesnoneNoDate the sales representative left work in the territory.
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on SalesTerritoryHistory
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_SalesTerritoryHistory_rowguidUnique nonclustered index. Used to support replication samples.NoYesNONCLUSTEREDrowguid
PK_SalesTerritoryHistory_SalesPersonID_StartDate_TerritoryIDClustered index created by a primary key constraint.YesYesCLUSTEREDSalesPersonID, StartDate, TerritoryID
Foreign Keys in SalesTerritoryHistory
Foreign Key NameColumnsReferences Table (Columns)Description
FK_SalesTerritoryHistory_SalesPerson_SalesPersonIDSalesPersonIDSales.SalesPerson (SalesPersonID)Foreign key constraint referencing SalesPerson.SalesPersonID.
FK_SalesTerritoryHistory_SalesTerritory_TerritoryIDTerritoryIDSales.SalesTerritory (TerritoryID)Foreign key constraint referencing SalesTerritory.TerritoryID.

Sales.ShoppingCartItem (table)

Contains online customer orders until the order is submitted or cancelled.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
ShoppingCartItemIDint (identity)10,0NononeNoPrimary key for ShoppingCartItem records.
ShoppingCartIDnvarchar50NononeNoShopping cart identification number.
Quantityint10,0No((1))NoProduct quantity ordered.
ProductIDint10,0NononeNoProduct ordered. Foreign key to Product.ProductID.
DateCreateddatetimeNo(getdate())NoDate the time the record was created.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on ShoppingCartItem
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
IX_ShoppingCartItem_ShoppingCartID_ProductIDNonclustered index.NoNoNONCLUSTEREDShoppingCartID, ProductID
PK_ShoppingCartItem_ShoppingCartItemIDClustered index created by a primary key constraint.YesYesCLUSTEREDShoppingCartItemID
Foreign Keys in ShoppingCartItem
Foreign Key NameColumnsReferences Table (Columns)Description
FK_ShoppingCartItem_Product_ProductIDProductIDProduction.Product (ProductID)Foreign key constraint referencing Product.ProductID.

Sales.SpecialOffer (table)

Sale discounts lookup table.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
SpecialOfferIDint (identity)10,0NononeNoPrimary key for SpecialOffer records.
Descriptionnvarchar255NononeNoDiscount description.
DiscountPctsmallmoney10,4No((0.00))NoDiscount precentage.
Typenvarchar50NononeNoDiscount type category.
Categorynvarchar50NononeNoGroup the discount applies to such as Reseller or Customer.
StartDatedatetimeNononeNoDiscount start date.
EndDatedatetimeNononeNoDiscount end date.
MinQtyint10,0No((0))NoMinimum discount percent allowed.
MaxQtyint10,0YesnoneNoMaximum discount percent allowed.
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on SpecialOffer
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_SpecialOffer_rowguidUnique nonclustered index. Used to support replication samples.NoYesNONCLUSTEREDrowguid
PK_SpecialOffer_SpecialOfferIDClustered index created by a primary key constraint.YesYesCLUSTEREDSpecialOfferID

Sales.SpecialOfferProduct (table)

Cross-reference table mapping products to special offer discounts.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
SpecialOfferIDint10,0NononeNoPrimary key for SpecialOfferProduct records.
ProductIDint10,0NononeNoProduct identification number. Foreign key to Product.ProductID.
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on SpecialOfferProduct
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_SpecialOfferProduct_rowguidUnique nonclustered index. Used to support replication samples.NoYesNONCLUSTEREDrowguid
IX_SpecialOfferProduct_ProductIDNonclustered index.NoNoNONCLUSTEREDProductID
PK_SpecialOfferProduct_SpecialOfferID_ProductIDClustered index created by a primary key constraint.YesYesCLUSTEREDSpecialOfferID, ProductID
Foreign Keys in SpecialOfferProduct
Foreign Key NameColumnsReferences Table (Columns)Description
FK_SpecialOfferProduct_Product_ProductIDProductIDProduction.Product (ProductID)Foreign key constraint referencing Product.ProductID.
FK_SpecialOfferProduct_SpecialOffer_SpecialOfferIDSpecialOfferIDSales.SpecialOffer (SpecialOfferID)Foreign key constraint referencing SpecialOffer.SpecialOfferID.

Sales.Store (table)

Customers (resellers) of Adventure Works products.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
CustomerIDint10,0NononeNoPrimary key. Foreign key to Customer.CustomerID.
Namenvarchar50NononeNoName of the store.
SalesPersonIDint10,0YesnoneNoID of the sales person assigned to the customer. Foreign key to SalesPerson.SalesPersonID.
DemographicsxmlYesnoneNoDemographic informationg about the store such as the number of employees, annual sales and store type.
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on Store
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_Store_rowguidUnique nonclustered index. Used to support replication samples.NoYesNONCLUSTEREDrowguid
IX_Store_SalesPersonIDNonclustered index.NoNoNONCLUSTEREDSalesPersonID
PK_Store_CustomerIDClustered index created by a primary key constraint.YesYesCLUSTEREDCustomerID
PXML_Store_DemographicsPrimary XML index.NoNoXMLDemographics
Foreign Keys in Store
Foreign Key NameColumnsReferences Table (Columns)Description
FK_Store_Customer_CustomerIDCustomerIDSales.Customer (CustomerID)Foreign key constraint referencing Customer.CustomerID.
FK_Store_SalesPerson_SalesPersonIDSalesPersonIDSales.SalesPerson (SalesPersonID)Foreign key constraint referencing SalesPerson.SalesPersonID

Sales.StoreContact (table)

Cross-reference table mapping stores and their employees.
Column NameSystem Data TypeSizeAllow NullDefaultIs ComputedDescription
CustomerIDint10,0NononeNoStore identification number. Foreign key to Customer.CustomerID.
ContactIDint10,0NononeNoContact (store employee) identification number. Foreign key to Contact.ContactID.
ContactTypeIDint10,0NononeNoContact type such as owner or purchasing agent. Foreign key to ContactType.ContactTypeID.
rowguiduniqueidentifierNo(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimeNo(getdate())NoDate and time the record was last updated.
Indexes on StoreContact
Index NameDescriptionIs Primary KeyIs UniqueIndex TypeColumns
AK_StoreContact_rowguidUnique nonclustered index. Used to support replication samples.NoYesNONCLUSTEREDrowguid
IX_StoreContact_ContactIDNonclustered index.NoNoNONCLUSTEREDContactID
IX_StoreContact_ContactTypeIDNonclustered index.NoNoNONCLUSTEREDContactTypeID
PK_StoreContact_CustomerID_ContactIDClustered index created by a primary key constraint.YesYesCLUSTEREDCustomerID, ContactID
Foreign Keys in StoreContact
Foreign Key NameColumnsReferences Table (Columns)Description
FK_StoreContact_Contact_ContactIDContactIDPerson.Contact (ContactID)Foreign key constraint referencing Contact.ContactID.
FK_StoreContact_ContactType_ContactTypeIDContactTypeIDPerson.ContactType (ContactTypeID)Foreign key constraint referencing ContactType.ContactTypeID.
FK_StoreContact_Store_CustomerIDCustomerIDSales.Store (CustomerID)Foreign key constraint referencing Store.CustomerID.

Sales.vIndividualCustomer (view)

Individual customers (names and addresses) that purchase Adventure Works Cycles products online.
Column NameSystem Data TypeSizeAllow NullDefaultIs Computed
CustomerIDint10,0NononeNo
Titlenvarchar8YesnoneNo
FirstNamenvarchar50NononeNo
MiddleNamenvarchar50YesnoneNo
LastNamenvarchar50NononeNo
Suffixnvarchar10YesnoneNo
Phonenvarchar25YesnoneNo
EmailAddressnvarchar50YesnoneNo
EmailPromotionint10,0NononeNo
AddressTypenvarchar50NononeNo
AddressLine1nvarchar60NononeNo
AddressLine2nvarchar60YesnoneNo
Citynvarchar30NononeNo
StateProvinceNamenvarchar50NononeNo
PostalCodenvarchar15NononeNo
CountryRegionNamenvarchar50NononeNo
DemographicsxmlYesnoneNo

Sales.vIndividualDemographics (view)

Displays the content from each element in the xml column Demographics for each customer in the Sales.Individual table.
Column NameSystem Data TypeSizeAllow NullDefaultIs Computed
CustomerIDint10,0NononeNo
TotalPurchaseYTDmoney19,4YesnoneNo
DateFirstPurchasedatetimeYesnoneNo
BirthDatedatetimeYesnoneNo
MaritalStatusnvarchar1YesnoneNo
YearlyIncomenvarchar30YesnoneNo
Gendernvarchar1YesnoneNo
TotalChildrenint10,0YesnoneNo
NumberChildrenAtHomeint10,0YesnoneNo
Educationnvarchar30YesnoneNo
Occupationnvarchar30YesnoneNo
HomeOwnerFlagbitYesnoneNo
NumberCarsOwnedint10,0YesnoneNo

Sales.vSalesPerson (view)

Sales representiatives (names and addresses) and their sales-related information.
Column NameSystem Data TypeSizeAllow NullDefaultIs Computed
SalesPersonIDint10,0NononeNo
Titlenvarchar8YesnoneNo
FirstNamenvarchar50NononeNo
MiddleNamenvarchar50YesnoneNo
LastNamenvarchar50NononeNo
Suffixnvarchar10YesnoneNo
JobTitlenvarchar50NononeNo
Phonenvarchar25YesnoneNo
EmailAddressnvarchar50YesnoneNo
EmailPromotionint10,0NononeNo
AddressLine1nvarchar60NononeNo
AddressLine2nvarchar60YesnoneNo
Citynvarchar30NononeNo
StateProvinceNamenvarchar50NononeNo
PostalCodenvarchar15NononeNo
CountryRegionNamenvarchar50NononeNo
TerritoryNamenvarchar50YesnoneNo
TerritoryGroupnvarchar50YesnoneNo
SalesQuotamoney19,4YesnoneNo
SalesYTDmoney19,4NononeNo
SalesLastYearmoney19,4NononeNo

Sales.vSalesPersonSalesByFiscalYears (view)

Uses PIVOT to return aggregated sales information for each sales representative.
Column NameSystem Data TypeSizeAllow NullDefaultIs Computed
SalesPersonIDint10,0YesnoneNo
FullNamenvarchar152YesnoneNo
Titlenvarchar50NononeNo
SalesTerritorynvarchar50NononeNo
2002money19,4YesnoneNo
2003money19,4YesnoneNo
2004money19,4YesnoneNo

Sales.vStoreWithDemographics (view)

Stores (names and addresses) that sell Adventure Works Cycles products to consumers.
Column NameSystem Data TypeSizeAllow NullDefaultIs Computed
CustomerIDint10,0NononeNo
Namenvarchar50NononeNo
ContactTypenvarchar50NononeNo
Titlenvarchar8YesnoneNo
FirstNamenvarchar50NononeNo
MiddleNamenvarchar50YesnoneNo
LastNamenvarchar50NononeNo
Suffixnvarchar10YesnoneNo
Phonenvarchar25YesnoneNo
EmailAddressnvarchar50YesnoneNo
EmailPromotionint10,0NononeNo
AddressTypenvarchar50NononeNo
AddressLine1nvarchar60NononeNo
AddressLine2nvarchar60YesnoneNo
Citynvarchar30NononeNo
StateProvinceNamenvarchar50NononeNo
PostalCodenvarchar15NononeNo
CountryRegionNamenvarchar50NononeNo
AnnualSalesmoney19,4YesnoneNo
AnnualRevenuemoney19,4YesnoneNo
BankNamenvarchar50YesnoneNo
BusinessTypenvarchar5YesnoneNo
YearOpenedint10,0YesnoneNo
Specialtynvarchar50YesnoneNo
SquareFeetint10,0YesnoneNo
Brandsnvarchar30YesnoneNo
Internetnvarchar30YesnoneNo
NumberEmployeesint10,0YesnoneNo

Documentation created using SQL Server Database Documentation Generator version 1.3.0
http://jeremykdev.github.io/SqlServerDatabaseDocumentationGenerator/