Lookup table containing the departments within the Adventure Works Cycles company.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | DepartmentID | smallint NOT NULL IDENTITY | Primary key for Department records. |
| * | Name | HumanResources.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Name of the department. |
| * | GroupName | HumanResources.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Name of the group to which the department belongs. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Referring Foreign Key | |||
| FK_EmployeeDepartmentHistory_Department_DepartmentID | DepartmentID ↙ ❏ HumanResources.EmployeeDepartmentHistory | ||
Employee information such as salary, department, and title.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | BusinessEntityID | int NOT NULL | Primary key for Employee records. Foreign key to BusinessEntity.BusinessEntityID. |
| * | NationalIDNumber | nvarchar(15) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Unique national identification number such as a social security number. |
| * | LoginID | nvarchar(256) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Network login. |
| OrganizationNode | hierarchyid | Where the employee is located in corporate hierarchy. | |
| OrganizationLevel | text | The depth of the employee in the corporate hierarchy. | |
| * | JobTitle | nvarchar(50) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Work title such as Buyer or Sales Representative. |
| * | BirthDate | date NOT NULL | Date of birth. |
| * | MaritalStatus | nchar(1) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | M = Married, S = Single |
| * | Gender | nchar(1) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | M = Male, F = Female |
| * | HireDate | date NOT NULL | Employee hired on this date. |
| * | SalariedFlag | HumanResources.Flag NOT NULL DEFAULT ((1)) | Job classification. 0 = Hourly, not exempt from collective bargaining. 1 = Salaried, exempt from collective bargaining. |
| * | VacationHours | smallint NOT NULL DEFAULT 0 | Number of available vacation hours. |
| * | SickLeaveHours | smallint NOT NULL DEFAULT 0 | Number of available sick leave hours. |
| * | CurrentFlag | HumanResources.Flag NOT NULL DEFAULT ((1)) | 0 = Inactive, 1 = Active |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_Employee_Person_BusinessEntityID | BusinessEntityID ↗ ❏ Person.Person | ||
| Referring Foreign Key | |||
| FK_EmployeeDepartmentHistory_Employee_BusinessEntityID | BusinessEntityID ↙ ❏ HumanResources.EmployeeDepartmentHistory | ||
| FK_EmployeePayHistory_Employee_BusinessEntityID | BusinessEntityID ↙ ❏ HumanResources.EmployeePayHistory | ||
| FK_JobCandidate_Employee_BusinessEntityID | BusinessEntityID ↙ ❏ HumanResources.JobCandidate | ||
| FK_Document_Employee_Owner | BusinessEntityID ↙ ❏ Production.Document(Owner) | ||
| FK_PurchaseOrderHeader_Employee_EmployeeID | BusinessEntityID ↙ ❏ Purchasing.PurchaseOrderHeader(EmployeeID) | ||
| FK_SalesPerson_Employee_BusinessEntityID | BusinessEntityID ↙ ❏ Sales.SalesPerson | ||
| Constraints | |||
| CK_Employee_BirthDate | [BirthDate]>='1930-01-01' AND [BirthDate]<=dateadd(year,(-18),getdate()) | ||
| CK_Employee_MaritalStatus | upper([MaritalStatus])='S' OR upper([MaritalStatus])='M' | ||
| CK_Employee_HireDate | [HireDate]>='1996-07-01' AND [HireDate]<=dateadd(day,(1),getdate()) | ||
| CK_Employee_Gender | upper([Gender])='F' OR upper([Gender])='M' | ||
| CK_Employee_VacationHours | [VacationHours]>=(-40) AND [VacationHours]<=(240) | ||
| CK_Employee_SickLeaveHours | [SickLeaveHours]>=(0) AND [SickLeaveHours]<=(120) | ||
| Triggers | |||
Employee department transfers.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | BusinessEntityID | int NOT NULL | Employee identification number. Foreign key to Employee.BusinessEntityID. |
| * | DepartmentID | smallint NOT NULL | Department in which the employee worked including currently. Foreign key to Department.DepartmentID. |
| * | ShiftID | tinyint NOT NULL | Identifies which 8-hour shift the employee works. Foreign key to Shift.Shift.ID. |
| * | StartDate | date NOT NULL | Date the employee started work in the department. |
| EndDate | date | Date the employee left the department. NULL = Current department. | |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_EmployeeDepartmentHistory_Department_DepartmentID | DepartmentID ↗ ❏ HumanResources.Department | ||
| FK_EmployeeDepartmentHistory_Employee_BusinessEntityID | BusinessEntityID ↗ ❏ HumanResources.Employee | ||
| FK_EmployeeDepartmentHistory_Shift_ShiftID | ShiftID ↗ ❏ HumanResources.Shift | ||
| Constraints | |||
| CK_EmployeeDepartmentHistory_EndDate | [EndDate]>=[StartDate] OR [EndDate] IS NULL | ||
Employee pay history.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | BusinessEntityID | int NOT NULL | Employee identification number. Foreign key to Employee.BusinessEntityID. |
| * | RateChangeDate | datetime NOT NULL | Date the change in pay is effective |
| * | Rate | money NOT NULL | Salary hourly rate. |
| * | PayFrequency | tinyint NOT NULL | 1 = Salary received monthly, 2 = Salary received biweekly |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_EmployeePayHistory_Employee_BusinessEntityID | BusinessEntityID ↗ ❏ HumanResources.Employee | ||
| Constraints | |||
| CK_EmployeePayHistory_PayFrequency | [PayFrequency]=(2) OR [PayFrequency]=(1) | ||
| CK_EmployeePayHistory_Rate | [Rate]>=(6.50) AND [Rate]<=(200.00) | ||
Résumés submitted to Human Resources by job applicants.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | JobCandidateID | int NOT NULL IDENTITY | Primary key for JobCandidate records. |
| BusinessEntityID | int | Employee identification number if applicant was hired. Foreign key to Employee.BusinessEntityID. | |
| Resume | xml | Résumé in XML format. | |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_JobCandidate_Employee_BusinessEntityID | BusinessEntityID ↗ ❏ HumanResources.Employee | ||
Work shift lookup table.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | ShiftID | tinyint NOT NULL IDENTITY | Primary key for Shift records. |
| * | Name | HumanResources.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Shift description. |
| * | StartTime | time NOT NULL | Shift start time. |
| * | EndTime | time NOT NULL | Shift end time. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Referring Foreign Key | |||
| FK_EmployeeDepartmentHistory_Shift_ShiftID | ShiftID ↙ ❏ HumanResources.EmployeeDepartmentHistory | ||
Street address information for customers, employees, and vendors.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | AddressID | int NOT NULL IDENTITY | Primary key for Address records. |
| * | AddressLine1 | nvarchar(60) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | First street address line. |
| AddressLine2 | nvarchar(60) COLLATE SQL_Latin1_General_CP1_CI_AS | Second street address line. | |
| * | City | nvarchar(30) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Name of the city. |
| * | StateProvinceID | int NOT NULL | Unique identification number for the state or province. Foreign key to StateProvince table. |
| * | PostalCode | nvarchar(15) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Postal code for the street address. |
| SpatialLocation | geography | Latitude and longitude of this address. | |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_Address_StateProvince_StateProvinceID | StateProvinceID ↗ ❏ Person.StateProvince | ||
| Referring Foreign Key | |||
| FK_BusinessEntityAddress_Address_AddressID | AddressID ↙ ❏ Person.BusinessEntityAddress | ||
| FK_SalesOrderHeader_Address_BillToAddressID | AddressID ↙ ❏ Sales.SalesOrderHeader(BillToAddressID) | ||
| FK_SalesOrderHeader_Address_ShipToAddressID | AddressID ↙ ❏ Sales.SalesOrderHeader(ShipToAddressID) | ||
Types of addresses stored in the Address table.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | AddressTypeID | int NOT NULL IDENTITY | Primary key for AddressType records. |
| * | Name | Person.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Address type description. For example, Billing, Home, or Shipping. |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Referring Foreign Key | |||
| FK_BusinessEntityAddress_AddressType_AddressTypeID | AddressTypeID ↙ ❏ Person.BusinessEntityAddress | ||
Source of the ID that connects vendors, customers, and employees with address and contact information.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | BusinessEntityID | int NOT NULL IDENTITY | Primary key for all customers, vendors, and employees. |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Referring Foreign Key | |||
| FK_BusinessEntityAddress_BusinessEntity_BusinessEntityID | BusinessEntityID ↙ ❏ Person.BusinessEntityAddress | ||
| FK_BusinessEntityContact_BusinessEntity_BusinessEntityID | BusinessEntityID ↙ ❏ Person.BusinessEntityContact | ||
| FK_Person_BusinessEntity_BusinessEntityID | BusinessEntityID ↙ ❏ Person.Person | ||
| FK_Vendor_BusinessEntity_BusinessEntityID | BusinessEntityID ↙ ❏ Purchasing.Vendor | ||
| FK_Store_BusinessEntity_BusinessEntityID | BusinessEntityID ↙ ❏ Sales.Store | ||
Cross-reference table mapping customers, vendors, and employees to their addresses.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | BusinessEntityID | int NOT NULL | Primary key. Foreign key to BusinessEntity.BusinessEntityID. |
| * | AddressID | int NOT NULL | Primary key. Foreign key to Address.AddressID. |
| * | AddressTypeID | int NOT NULL | Primary key. Foreign key to AddressType.AddressTypeID. |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_BusinessEntityAddress_Address_AddressID | AddressID ↗ ❏ Person.Address | ||
| FK_BusinessEntityAddress_AddressType_AddressTypeID | AddressTypeID ↗ ❏ Person.AddressType | ||
| FK_BusinessEntityAddress_BusinessEntity_BusinessEntityID | BusinessEntityID ↗ ❏ Person.BusinessEntity | ||
Cross-reference table mapping stores, vendors, and employees to people
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | BusinessEntityID | int NOT NULL | Primary key. Foreign key to BusinessEntity.BusinessEntityID. |
| * | PersonID | int NOT NULL | Primary key. Foreign key to Person.BusinessEntityID. |
| * | ContactTypeID | int NOT NULL | Primary key. Foreign key to ContactType.ContactTypeID. |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_BusinessEntityContact_BusinessEntity_BusinessEntityID | BusinessEntityID ↗ ❏ Person.BusinessEntity | ||
| FK_BusinessEntityContact_ContactType_ContactTypeID | ContactTypeID ↗ ❏ Person.ContactType | ||
| FK_BusinessEntityContact_Person_PersonID | PersonID ↗ ❏ Person.Person(BusinessEntityID) | ||
Lookup table containing the types of business entity contacts.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | ContactTypeID | int NOT NULL IDENTITY | Primary key for ContactType records. |
| * | Name | Person.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Contact type description. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Referring Foreign Key | |||
| FK_BusinessEntityContact_ContactType_ContactTypeID | ContactTypeID ↙ ❏ Person.BusinessEntityContact | ||
Lookup table containing the ISO standard codes for countries and regions.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | CountryRegionCode | nvarchar(3) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | ISO standard code for countries and regions. |
| * | Name | Person.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Country or region name. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Referring Foreign Key | |||
| FK_StateProvince_CountryRegion_CountryRegionCode | CountryRegionCode ↙ ❏ Person.StateProvince | ||
| FK_CountryRegionCurrency_CountryRegion_CountryRegionCode | CountryRegionCode ↙ ❏ Sales.CountryRegionCurrency | ||
| FK_SalesTerritory_CountryRegion_CountryRegionCode | CountryRegionCode ↙ ❏ Sales.SalesTerritory | ||
Where to send a person email.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | BusinessEntityID | int NOT NULL | Primary key. Person associated with this email address. Foreign key to Person.BusinessEntityID |
| * | EmailAddressID | int NOT NULL IDENTITY | Primary key. ID of this email address. |
| EmailAddress | nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS | E-mail address for the person. | |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_EmailAddress_Person_BusinessEntityID | BusinessEntityID ↗ ❏ Person.Person | ||
One way hashed authentication information
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | BusinessEntityID | int NOT NULL | |
| * | PasswordHash | varchar(128) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Password for the e-mail account. |
| * | PasswordSalt | varchar(10) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Random value concatenated with the password string before the password is hashed. |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_Password_Person_BusinessEntityID | BusinessEntityID ↗ ❏ Person.Person | ||
Human beings involved with AdventureWorks: employees, customer contacts, and vendor contacts.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | BusinessEntityID | int NOT NULL | Primary key for Person records. |
| * | PersonType | nchar(2) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Primary type of person: SC = Store Contact, IN = Individual (retail) customer, SP = Sales person, EM = Employee (non-sales), VC = Vendor contact, GC = General contact |
| * | NameStyle | Person.NameStyle NOT NULL DEFAULT ((0)) | 0 = The data in FirstName and LastName are stored in western style (first name, last name) order. 1 = Eastern style (last name, first name) order. |
| Title | nvarchar(8) COLLATE SQL_Latin1_General_CP1_CI_AS | A courtesy title. For example, Mr. or Ms. | |
| * | FirstName | Person.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | First name of the person. |
| MiddleName | Person.Name COLLATE SQL_Latin1_General_CP1_CI_AS | Middle name or middle initial of the person. | |
| * | LastName | Person.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Last name of the person. |
| Suffix | nvarchar(10) COLLATE SQL_Latin1_General_CP1_CI_AS | Surname suffix. For example, Sr. or Jr. | |
| * | EmailPromotion | int NOT NULL DEFAULT 0 | 0 = Contact does not wish to receive e-mail promotions, 1 = Contact does wish to receive e-mail promotions from AdventureWorks, 2 = Contact does wish to receive e-mail promotions from AdventureWorks and selected partners. |
| AdditionalContactInfo | xml | Additional contact information about the person stored in xml format. | |
| Demographics | xml | Personal information such as hobbies, and income collected from online shoppers. Used for sales analysis. | |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_Person_BusinessEntity_BusinessEntityID | BusinessEntityID ↗ ❏ Person.BusinessEntity | ||
| Referring Foreign Key | |||
| FK_Employee_Person_BusinessEntityID | BusinessEntityID ↙ ❏ HumanResources.Employee | ||
| FK_BusinessEntityContact_Person_PersonID | BusinessEntityID ↙ ❏ Person.BusinessEntityContact(PersonID) | ||
| FK_EmailAddress_Person_BusinessEntityID | BusinessEntityID ↙ ❏ Person.EmailAddress | ||
| FK_Password_Person_BusinessEntityID | BusinessEntityID ↙ ❏ Person.Password | ||
| FK_PersonPhone_Person_BusinessEntityID | BusinessEntityID ↙ ❏ Person.PersonPhone | ||
| FK_Customer_Person_PersonID | BusinessEntityID ↙ ❏ Sales.Customer(PersonID) | ||
| FK_PersonCreditCard_Person_BusinessEntityID | BusinessEntityID ↙ ❏ Sales.PersonCreditCard | ||
| Constraints | |||
| CK_Person_EmailPromotion | [EmailPromotion]>=(0) AND [EmailPromotion]<=(2) | ||
| CK_Person_PersonType | [PersonType] IS NULL OR (upper([PersonType])='GC' OR upper([PersonType])='SP' OR upper([PersonType])='EM' OR upper([PersonType])='IN' OR upper([PersonType])='VC' OR upper([PersonType])='SC') | ||
| Triggers | |||
Telephone number and type of a person.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | BusinessEntityID | int NOT NULL | Business entity identification number. Foreign key to Person.BusinessEntityID. |
| * | PhoneNumber | Person.Phone NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Telephone number identification number. |
| * | PhoneNumberTypeID | int NOT NULL | Kind of phone number. Foreign key to PhoneNumberType.PhoneNumberTypeID. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_PersonPhone_Person_BusinessEntityID | BusinessEntityID ↗ ❏ Person.Person | ||
| FK_PersonPhone_PhoneNumberType_PhoneNumberTypeID | PhoneNumberTypeID ↗ ❏ Person.PhoneNumberType | ||
Type of phone number of a person.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | PhoneNumberTypeID | int NOT NULL IDENTITY | Primary key for telephone number type records. |
| * | Name | Person.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Name of the telephone number type |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Referring Foreign Key | |||
| FK_PersonPhone_PhoneNumberType_PhoneNumberTypeID | PhoneNumberTypeID ↙ ❏ Person.PersonPhone | ||
State and province lookup table.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | StateProvinceID | int NOT NULL IDENTITY | Primary key for StateProvince records. |
| * | StateProvinceCode | nchar(3) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | ISO standard state or province code. |
| * | CountryRegionCode | nvarchar(3) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode. |
| * | IsOnlyStateProvinceFlag | Person.Flag NOT NULL DEFAULT ((1)) | 0 = StateProvinceCode exists. 1 = StateProvinceCode unavailable, using CountryRegionCode. |
| * | Name | Person.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | State or province description. |
| * | TerritoryID | int NOT NULL | ID of the territory in which the state or province is located. Foreign key to SalesTerritory.SalesTerritoryID. |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_StateProvince_CountryRegion_CountryRegionCode | CountryRegionCode ↗ ❏ Person.CountryRegion | ||
| FK_StateProvince_SalesTerritory_TerritoryID | TerritoryID ↗ ❏ Sales.SalesTerritory | ||
| Referring Foreign Key | |||
| FK_Address_StateProvince_StateProvinceID | StateProvinceID ↙ ❏ Person.Address | ||
| FK_SalesTaxRate_StateProvince_StateProvinceID | StateProvinceID ↙ ❏ Sales.SalesTaxRate | ||
Items required to make bicycles and bicycle subassemblies. It identifies the heirarchical relationship between a parent product and its components.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | BillOfMaterialsID | int NOT NULL IDENTITY | Primary key for BillOfMaterials records. |
| ProductAssemblyID | int | Parent product identification number. Foreign key to Product.ProductID. | |
| * | ComponentID | int NOT NULL | Component identification number. Foreign key to Product.ProductID. |
| * | StartDate | datetime NOT NULL DEFAULT getdate() | Date the component started being used in the assembly item. |
| EndDate | datetime | Date the component stopped being used in the assembly item. | |
| * | UnitMeasureCode | nchar(3) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Standard code identifying the unit of measure for the quantity. |
| * | BOMLevel | smallint NOT NULL | Indicates the depth the component is from its parent (AssemblyID). |
| * | PerAssemblyQty | decimal(8,2) NOT NULL DEFAULT 1.00 | Quantity of the component needed to create the assembly. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_BillOfMaterials_Product_ComponentID | ComponentID ↗ ❏ Production.Product(ProductID) | ||
| FK_BillOfMaterials_Product_ProductAssemblyID | ProductAssemblyID ↗ ❏ Production.Product(ProductID) | ||
| FK_BillOfMaterials_UnitMeasure_UnitMeasureCode | UnitMeasureCode ↗ ❏ Production.UnitMeasure | ||
| Constraints | |||
| CK_BillOfMaterials_EndDate | [EndDate]>[StartDate] OR [EndDate] IS NULL | ||
| CK_BillOfMaterials_ProductAssemblyID | [ProductAssemblyID]<>[ComponentID] | ||
| CK_BillOfMaterials_BOMLevel | [ProductAssemblyID] IS NULL AND [BOMLevel]=(0) AND [PerAssemblyQty]=(1.00) OR [ProductAssemblyID] IS NOT NULL AND [BOMLevel]>=(1) | ||
| CK_BillOfMaterials_PerAssemblyQty | [PerAssemblyQty]>=(1.00) | ||
Lookup table containing the languages in which some AdventureWorks data is stored.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | CultureID | nchar(6) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Primary key for Culture records. |
| * | Name | Production.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Culture description. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Referring Foreign Key | |||
| FK_ProductModelProductDescriptionCulture_Culture_CultureID | CultureID ↙ ❏ Production.ProductModelProductDescriptionCulture | ||
Product maintenance documents.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | DocumentNode | hierarchyid NOT NULL | Primary key for Document records. |
| DocumentLevel | text | Depth in the document hierarchy. | |
| * | Title | nvarchar(50) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Title of the document. |
| * | Owner | int NOT NULL | Employee who controls the document. Foreign key to Employee.BusinessEntityID |
| * | FolderFlag | bit NOT NULL DEFAULT 0 | 0 = This is a folder, 1 = This is a document. |
| * | FileName | nvarchar(400) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | File name of the document |
| * | FileExtension | nvarchar(8) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | File extension indicating the document type. For example, .doc or .txt. |
| * | Revision | nchar(5) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Revision number of the document. |
| * | ChangeNumber | int NOT NULL DEFAULT 0 | Engineering change approval number. |
| * | Status | tinyint NOT NULL | 1 = Pending approval, 2 = Approved, 3 = Obsolete |
| DocumentSummary | nvarchar(max) COLLATE SQL_Latin1_General_CP1_CI_AS | Document abstract. | |
| Document | varbinary(max) | Complete document. | |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Required for FileStream. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_Document_Employee_Owner | Owner ↗ ❏ HumanResources.Employee(BusinessEntityID) | ||
| Referring Foreign Key | |||
| FK_ProductDocument_Document_DocumentNode | DocumentNode ↙ ❏ Production.ProductDocument | ||
| Constraints | |||
| CK_Document_Status | [Status]>=(1) AND [Status]<=(3) | ||
Bicycle assembly diagrams.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | IllustrationID | int NOT NULL IDENTITY | Primary key for Illustration records. |
| Diagram | xml | Illustrations used in manufacturing instructions. Stored as XML. | |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Referring Foreign Key | |||
| FK_ProductModelIllustration_Illustration_IllustrationID | IllustrationID ↙ ❏ Production.ProductModelIllustration | ||
Product inventory and manufacturing locations.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | LocationID | smallint NOT NULL IDENTITY | Primary key for Location records. |
| * | Name | Production.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Location description. |
| * | CostRate | smallmoney NOT NULL DEFAULT 0.00 | Standard hourly cost of the manufacturing location. |
| * | Availability | decimal(8,2) NOT NULL DEFAULT 0.00 | Work capacity (in hours) of the manufacturing location. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Referring Foreign Key | |||
| FK_ProductInventory_Location_LocationID | LocationID ↙ ❏ Production.ProductInventory | ||
| FK_WorkOrderRouting_Location_LocationID | LocationID ↙ ❏ Production.WorkOrderRouting | ||
| Constraints | |||
| CK_Location_CostRate | [CostRate]>=(0.00) | ||
| CK_Location_Availability | [Availability]>=(0.00) | ||
Products sold or used in the manfacturing of sold products.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | ProductID | int NOT NULL IDENTITY | Primary key for Product records. |
| * | Name | Production.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Name of the product. |
| * | ProductNumber | nvarchar(25) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Unique product identification number. |
| * | MakeFlag | Production.Flag NOT NULL DEFAULT ((1)) | 0 = Product is purchased, 1 = Product is manufactured in-house. |
| * | FinishedGoodsFlag | Production.Flag NOT NULL DEFAULT ((1)) | 0 = Product is not a salable item. 1 = Product is salable. |
| Color | nvarchar(15) COLLATE SQL_Latin1_General_CP1_CI_AS | Product color. | |
| * | SafetyStockLevel | smallint NOT NULL | Minimum inventory quantity. |
| * | ReorderPoint | smallint NOT NULL | Inventory level that triggers a purchase order or work order. |
| * | StandardCost | money NOT NULL | Standard cost of the product. |
| * | ListPrice | money NOT NULL | Selling price. |
| Size | nvarchar(5) COLLATE SQL_Latin1_General_CP1_CI_AS | Product size. | |
| SizeUnitMeasureCode | nchar(3) COLLATE SQL_Latin1_General_CP1_CI_AS | Unit of measure for Size column. | |
| WeightUnitMeasureCode | nchar(3) COLLATE SQL_Latin1_General_CP1_CI_AS | Unit of measure for Weight column. | |
| Weight | decimal(8,2) | Product weight. | |
| * | DaysToManufacture | int NOT NULL | Number of days required to manufacture the product. |
| ProductLine | nchar(2) COLLATE SQL_Latin1_General_CP1_CI_AS | R = Road, M = Mountain, T = Touring, S = Standard | |
| Class | nchar(2) COLLATE SQL_Latin1_General_CP1_CI_AS | H = High, M = Medium, L = Low | |
| Style | nchar(2) COLLATE SQL_Latin1_General_CP1_CI_AS | W = Womens, M = Mens, U = Universal | |
| ProductSubcategoryID | int | Product is a member of this product subcategory. Foreign key to ProductSubCategory.ProductSubCategoryID. | |
| ProductModelID | int | Product is a member of this product model. Foreign key to ProductModel.ProductModelID. | |
| * | SellStartDate | datetime NOT NULL | Date the product was available for sale. |
| SellEndDate | datetime | Date the product was no longer available for sale. | |
| DiscontinuedDate | datetime | Date the product was discontinued. | |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_Product_ProductModel_ProductModelID | ProductModelID ↗ ❏ Production.ProductModel | ||
| FK_Product_ProductSubcategory_ProductSubcategoryID | ProductSubcategoryID ↗ ❏ Production.ProductSubcategory | ||
| FK_Product_UnitMeasure_SizeUnitMeasureCode | SizeUnitMeasureCode ↗ ❏ Production.UnitMeasure(UnitMeasureCode) | ||
| FK_Product_UnitMeasure_WeightUnitMeasureCode | WeightUnitMeasureCode ↗ ❏ Production.UnitMeasure(UnitMeasureCode) | ||
| Referring Foreign Key | |||
| FK_BillOfMaterials_Product_ComponentID | ProductID ↙ ❏ Production.BillOfMaterials(ComponentID) | ||
| FK_BillOfMaterials_Product_ProductAssemblyID | ProductID ↙ ❏ Production.BillOfMaterials(ProductAssemblyID) | ||
| FK_ProductCostHistory_Product_ProductID | ProductID ↙ ❏ Production.ProductCostHistory | ||
| FK_ProductDocument_Product_ProductID | ProductID ↙ ❏ Production.ProductDocument | ||
| FK_ProductInventory_Product_ProductID | ProductID ↙ ❏ Production.ProductInventory | ||
| FK_ProductListPriceHistory_Product_ProductID | ProductID ↙ ❏ Production.ProductListPriceHistory | ||
| FK_ProductProductPhoto_Product_ProductID | ProductID ↙ ❏ Production.ProductProductPhoto | ||
| FK_ProductReview_Product_ProductID | ProductID ↙ ❏ Production.ProductReview | ||
| FK_TransactionHistory_Product_ProductID | ProductID ↙ ❏ Production.TransactionHistory | ||
| FK_WorkOrder_Product_ProductID | ProductID ↙ ❏ Production.WorkOrder | ||
| FK_ProductVendor_Product_ProductID | ProductID ↙ ❏ Purchasing.ProductVendor | ||
| FK_PurchaseOrderDetail_Product_ProductID | ProductID ↙ ❏ Purchasing.PurchaseOrderDetail | ||
| FK_ShoppingCartItem_Product_ProductID | ProductID ↙ ❏ Sales.ShoppingCartItem | ||
| FK_SpecialOfferProduct_Product_ProductID | ProductID ↙ ❏ Sales.SpecialOfferProduct | ||
| Constraints | |||
| CK_Product_SafetyStockLevel | [SafetyStockLevel]>(0) | ||
| CK_Product_ReorderPoint | [ReorderPoint]>(0) | ||
| CK_Product_StandardCost | [StandardCost]>=(0.00) | ||
| CK_Product_ListPrice | [ListPrice]>=(0.00) | ||
| CK_Product_Weight | [Weight]>(0.00) | ||
| CK_Product_DaysToManufacture | [DaysToManufacture]>=(0) | ||
| CK_Product_ProductLine | upper([ProductLine])='R' OR upper([ProductLine])='M' OR upper([ProductLine])='T' OR upper([ProductLine])='S' OR [ProductLine] IS NULL | ||
| CK_Product_Class | upper([Class])='H' OR upper([Class])='M' OR upper([Class])='L' OR [Class] IS NULL | ||
| CK_Product_Style | upper([Style])='U' OR upper([Style])='M' OR upper([Style])='W' OR [Style] IS NULL | ||
| CK_Product_SellEndDate | [SellEndDate]>=[SellStartDate] OR [SellEndDate] IS NULL | ||
High-level product categorization.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | ProductCategoryID | int NOT NULL IDENTITY | Primary key for ProductCategory records. |
| * | Name | Production.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Category description. |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Referring Foreign Key | |||
| FK_ProductSubcategory_ProductCategory_ProductCategoryID | ProductCategoryID ↙ ❏ Production.ProductSubcategory | ||
Changes in the cost of a product over time.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | ProductID | int NOT NULL | Product identification number. Foreign key to Product.ProductID |
| * | StartDate | datetime NOT NULL | Product cost start date. |
| EndDate | datetime | Product cost end date. | |
| * | StandardCost | money NOT NULL | Standard cost of the product. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_ProductCostHistory_Product_ProductID | ProductID ↗ ❏ Production.Product | ||
| Constraints | |||
| CK_ProductCostHistory_EndDate | [EndDate]>=[StartDate] OR [EndDate] IS NULL | ||
| CK_ProductCostHistory_StandardCost | [StandardCost]>=(0.00) | ||
Product descriptions in several languages.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | ProductDescriptionID | int NOT NULL IDENTITY | Primary key for ProductDescription records. |
| * | Description | nvarchar(400) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Description of the product. |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Referring Foreign Key | |||
| FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID | ProductDescriptionID ↙ ❏ Production.ProductModelProductDescriptionCulture | ||
Cross-reference table mapping products to related product documents.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | ProductID | int NOT NULL | Product identification number. Foreign key to Product.ProductID. |
| * | DocumentNode | hierarchyid NOT NULL | Document identification number. Foreign key to Document.DocumentNode. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_ProductDocument_Document_DocumentNode | DocumentNode ↗ ❏ Production.Document | ||
| FK_ProductDocument_Product_ProductID | ProductID ↗ ❏ Production.Product | ||
Product inventory information.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | ProductID | int NOT NULL | Product identification number. Foreign key to Product.ProductID. |
| * | LocationID | smallint NOT NULL | Inventory location identification number. Foreign key to Location.LocationID. |
| * | Shelf | nvarchar(10) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Storage compartment within an inventory location. |
| * | Bin | tinyint NOT NULL | Storage container on a shelf in an inventory location. |
| * | Quantity | smallint NOT NULL DEFAULT 0 | Quantity of products in the inventory location. |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_ProductInventory_Location_LocationID | LocationID ↗ ❏ Production.Location | ||
| FK_ProductInventory_Product_ProductID | ProductID ↗ ❏ Production.Product | ||
| Constraints | |||
| CK_ProductInventory_Shelf | [Shelf] like '[A-Za-z]' OR [Shelf]='N/A' | ||
| CK_ProductInventory_Bin | [Bin]>=(0) AND [Bin]<=(100) | ||
Changes in the list price of a product over time.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | ProductID | int NOT NULL | Product identification number. Foreign key to Product.ProductID |
| * | StartDate | datetime NOT NULL | List price start date. |
| EndDate | datetime | List price end date | |
| * | ListPrice | money NOT NULL | Product list price. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_ProductListPriceHistory_Product_ProductID | ProductID ↗ ❏ Production.Product | ||
| Constraints | |||
| CK_ProductListPriceHistory_EndDate | [EndDate]>=[StartDate] OR [EndDate] IS NULL | ||
| CK_ProductListPriceHistory_ListPrice | [ListPrice]>(0.00) | ||
Product model classification.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | ProductModelID | int NOT NULL IDENTITY | Primary key for ProductModel records. |
| * | Name | Production.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Product model description. |
| CatalogDescription | xml | Detailed product catalog information in xml format. | |
| Instructions | xml | Manufacturing instructions in xml format. | |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Referring Foreign Key | |||
| FK_Product_ProductModel_ProductModelID | ProductModelID ↙ ❏ Production.Product | ||
| FK_ProductModelIllustration_ProductModel_ProductModelID | ProductModelID ↙ ❏ Production.ProductModelIllustration | ||
| FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID | ProductModelID ↙ ❏ Production.ProductModelProductDescriptionCulture | ||
Cross-reference table mapping product models and illustrations.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | ProductModelID | int NOT NULL | Primary key. Foreign key to ProductModel.ProductModelID. |
| * | IllustrationID | int NOT NULL | Primary key. Foreign key to Illustration.IllustrationID. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_ProductModelIllustration_Illustration_IllustrationID | IllustrationID ↗ ❏ Production.Illustration | ||
| FK_ProductModelIllustration_ProductModel_ProductModelID | ProductModelID ↗ ❏ Production.ProductModel | ||
Cross-reference table mapping product descriptions and the language the description is written in.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | ProductModelID | int NOT NULL | Primary key. Foreign key to ProductModel.ProductModelID. |
| * | ProductDescriptionID | int NOT NULL | Primary key. Foreign key to ProductDescription.ProductDescriptionID. |
| * | CultureID | nchar(6) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Culture identification number. Foreign key to Culture.CultureID. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_ProductModelProductDescriptionCulture_Culture_CultureID | CultureID ↗ ❏ Production.Culture | ||
| FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID | ProductDescriptionID ↗ ❏ Production.ProductDescription | ||
| FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID | ProductModelID ↗ ❏ Production.ProductModel | ||
Product images.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | ProductPhotoID | int NOT NULL IDENTITY | Primary key for ProductPhoto records. |
| ThumbNailPhoto | varbinary(max) | Small image of the product. | |
| ThumbnailPhotoFileName | nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS | Small image file name. | |
| LargePhoto | varbinary(max) | Large image of the product. | |
| LargePhotoFileName | nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS | Large image file name. | |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Referring Foreign Key | |||
| FK_ProductProductPhoto_ProductPhoto_ProductPhotoID | ProductPhotoID ↙ ❏ Production.ProductProductPhoto | ||
Cross-reference table mapping products and product photos.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | ProductID | int NOT NULL | Product identification number. Foreign key to Product.ProductID. |
| * | ProductPhotoID | int NOT NULL | Product photo identification number. Foreign key to ProductPhoto.ProductPhotoID. |
| * | Primary | Production.Flag NOT NULL DEFAULT ((0)) | 0 = Photo is not the principal image. 1 = Photo is the principal image. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_ProductProductPhoto_Product_ProductID | ProductID ↗ ❏ Production.Product | ||
| FK_ProductProductPhoto_ProductPhoto_ProductPhotoID | ProductPhotoID ↗ ❏ Production.ProductPhoto | ||
Customer reviews of products they have purchased.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | ProductReviewID | int NOT NULL IDENTITY | Primary key for ProductReview records. |
| * | ProductID | int NOT NULL | Product identification number. Foreign key to Product.ProductID. |
| * | ReviewerName | Production.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Name of the reviewer. |
| * | ReviewDate | datetime NOT NULL DEFAULT getdate() | Date review was submitted. |
| * | EmailAddress | nvarchar(50) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Reviewer's e-mail address. |
| * | Rating | int NOT NULL | Product rating given by the reviewer. Scale is 1 to 5 with 5 as the highest rating. |
| Comments | nvarchar(3850) COLLATE SQL_Latin1_General_CP1_CI_AS | Reviewer's comments | |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_ProductReview_Product_ProductID | ProductID ↗ ❏ Production.Product | ||
| Constraints | |||
| CK_ProductReview_Rating | [Rating]>=(1) AND [Rating]<=(5) | ||
Product subcategories. See ProductCategory table.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | ProductSubcategoryID | int NOT NULL IDENTITY | Primary key for ProductSubcategory records. |
| * | ProductCategoryID | int NOT NULL | Product category identification number. Foreign key to ProductCategory.ProductCategoryID. |
| * | Name | Production.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Subcategory description. |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_ProductSubcategory_ProductCategory_ProductCategoryID | ProductCategoryID ↗ ❏ Production.ProductCategory | ||
| Referring Foreign Key | |||
| FK_Product_ProductSubcategory_ProductSubcategoryID | ProductSubcategoryID ↙ ❏ Production.Product | ||
Manufacturing failure reasons lookup table.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | ScrapReasonID | smallint NOT NULL IDENTITY | Primary key for ScrapReason records. |
| * | Name | Production.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Failure description. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Referring Foreign Key | |||
| FK_WorkOrder_ScrapReason_ScrapReasonID | ScrapReasonID ↙ ❏ Production.WorkOrder | ||
Record of each purchase order, sales order, or work order transaction year to date.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | TransactionID | int NOT NULL IDENTITY | Primary key for TransactionHistory records. |
| * | ProductID | int NOT NULL | Product identification number. Foreign key to Product.ProductID. |
| * | ReferenceOrderID | int NOT NULL | Purchase order, sales order, or work order identification number. |
| * | ReferenceOrderLineID | int NOT NULL DEFAULT 0 | Line number associated with the purchase order, sales order, or work order. |
| * | TransactionDate | datetime NOT NULL DEFAULT getdate() | Date and time of the transaction. |
| * | TransactionType | nchar(1) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | W = WorkOrder, S = SalesOrder, P = PurchaseOrder |
| * | Quantity | int NOT NULL | Product quantity. |
| * | ActualCost | money NOT NULL | Product cost. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_TransactionHistory_Product_ProductID | ProductID ↗ ❏ Production.Product | ||
| Constraints | |||
| CK_TransactionHistory_TransactionType | upper([TransactionType])='P' OR upper([TransactionType])='S' OR upper([TransactionType])='W' | ||
Transactions for previous years.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | TransactionID | int NOT NULL | Primary key for TransactionHistoryArchive records. |
| * | ProductID | int NOT NULL | Product identification number. Foreign key to Product.ProductID. |
| * | ReferenceOrderID | int NOT NULL | Purchase order, sales order, or work order identification number. |
| * | ReferenceOrderLineID | int NOT NULL DEFAULT 0 | Line number associated with the purchase order, sales order, or work order. |
| * | TransactionDate | datetime NOT NULL DEFAULT getdate() | Date and time of the transaction. |
| * | TransactionType | nchar(1) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | W = Work Order, S = Sales Order, P = Purchase Order |
| * | Quantity | int NOT NULL | Product quantity. |
| * | ActualCost | money NOT NULL | Product cost. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Constraints | |||
| CK_TransactionHistoryArchive_TransactionType | upper([TransactionType])='P' OR upper([TransactionType])='S' OR upper([TransactionType])='W' | ||
Unit of measure lookup table.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | UnitMeasureCode | nchar(3) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Primary key. |
| * | Name | Production.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Unit of measure description. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Referring Foreign Key | |||
| FK_BillOfMaterials_UnitMeasure_UnitMeasureCode | UnitMeasureCode ↙ ❏ Production.BillOfMaterials | ||
| FK_Product_UnitMeasure_SizeUnitMeasureCode | UnitMeasureCode ↙ ❏ Production.Product(SizeUnitMeasureCode) | ||
| FK_Product_UnitMeasure_WeightUnitMeasureCode | UnitMeasureCode ↙ ❏ Production.Product(WeightUnitMeasureCode) | ||
| FK_ProductVendor_UnitMeasure_UnitMeasureCode | UnitMeasureCode ↙ ❏ Purchasing.ProductVendor | ||
| Idx | Column Name | Data Type |
|---|---|---|
| * | WorkOrderID | int NOT NULL IDENTITY |
| * | ProductID | int NOT NULL |
| * | OrderQty | int NOT NULL |
| StockedQty | text | |
| * | ScrappedQty | smallint NOT NULL |
| * | StartDate | datetime NOT NULL |
| EndDate | datetime | |
| * | DueDate | datetime NOT NULL |
| ScrapReasonID | smallint | |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() |
| Foreign Key | ||
| FK_WorkOrder_Product_ProductID | ProductID ↗ ❏ Production.Product | |
| FK_WorkOrder_ScrapReason_ScrapReasonID | ScrapReasonID ↗ ❏ Production.ScrapReason | |
| Referring Foreign Key | ||
| FK_WorkOrderRouting_WorkOrder_WorkOrderID | WorkOrderID ↙ ❏ Production.WorkOrderRouting | |
| Constraints | ||
| CK_WorkOrder_OrderQty | [OrderQty]>(0) | |
| CK_WorkOrder_ScrappedQty | [ScrappedQty]>=(0) | |
| CK_WorkOrder_EndDate | [EndDate]>=[StartDate] OR [EndDate] IS NULL | |
| Triggers | ||
| Idx | Column Name | Data Type |
|---|---|---|
| * | WorkOrderID | int NOT NULL |
| * | ProductID | int NOT NULL |
| * | OperationSequence | smallint NOT NULL |
| * | LocationID | smallint NOT NULL |
| * | ScheduledStartDate | datetime NOT NULL |
| * | ScheduledEndDate | datetime NOT NULL |
| ActualStartDate | datetime | |
| ActualEndDate | datetime | |
| ActualResourceHrs | decimal(9,4) | |
| * | PlannedCost | money NOT NULL |
| ActualCost | money | |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() |
| Foreign Key | ||
| FK_WorkOrderRouting_Location_LocationID | LocationID ↗ ❏ Production.Location | |
| FK_WorkOrderRouting_WorkOrder_WorkOrderID | WorkOrderID ↗ ❏ Production.WorkOrder | |
| Constraints | ||
| CK_WorkOrderRouting_ScheduledEndDate | [ScheduledEndDate]>=[ScheduledStartDate] | |
| CK_WorkOrderRouting_ActualEndDate | [ActualEndDate]>=[ActualStartDate] OR [ActualEndDate] IS NULL OR [ActualStartDate] IS NULL | |
| CK_WorkOrderRouting_ActualResourceHrs | [ActualResourceHrs]>=(0.0000) | |
| CK_WorkOrderRouting_PlannedCost | [PlannedCost]>(0.00) | |
| CK_WorkOrderRouting_ActualCost | [ActualCost]>(0.00) | |
Cross-reference table mapping vendors with the products they supply.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | ProductID | int NOT NULL | Primary key. Foreign key to Product.ProductID. |
| * | BusinessEntityID | int NOT NULL | Primary key. Foreign key to Vendor.BusinessEntityID. |
| * | AverageLeadTime | int NOT NULL | The average span of time (in days) between placing an order with the vendor and receiving the purchased product. |
| * | StandardPrice | money NOT NULL | The vendor's usual selling price. |
| LastReceiptCost | money | The selling price when last purchased. | |
| LastReceiptDate | datetime | Date the product was last received by the vendor. | |
| * | MinOrderQty | int NOT NULL | The maximum quantity that should be ordered. |
| * | MaxOrderQty | int NOT NULL | The minimum quantity that should be ordered. |
| OnOrderQty | int | The quantity currently on order. | |
| * | UnitMeasureCode | nchar(3) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | The product's unit of measure. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_ProductVendor_Product_ProductID | ProductID ↗ ❏ Production.Product | ||
| FK_ProductVendor_UnitMeasure_UnitMeasureCode | UnitMeasureCode ↗ ❏ Production.UnitMeasure | ||
| FK_ProductVendor_Vendor_BusinessEntityID | BusinessEntityID ↗ ❏ Purchasing.Vendor | ||
| Constraints | |||
| CK_ProductVendor_AverageLeadTime | [AverageLeadTime]>=(1) | ||
| CK_ProductVendor_StandardPrice | [StandardPrice]>(0.00) | ||
| CK_ProductVendor_LastReceiptCost | [LastReceiptCost]>(0.00) | ||
| CK_ProductVendor_MinOrderQty | [MinOrderQty]>=(1) | ||
| CK_ProductVendor_MaxOrderQty | [MaxOrderQty]>=(1) | ||
| CK_ProductVendor_OnOrderQty | [OnOrderQty]>=(0) | ||
Individual products associated with a specific purchase order. See PurchaseOrderHeader.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | PurchaseOrderID | int NOT NULL | Primary key. Foreign key to PurchaseOrderHeader.PurchaseOrderID. |
| * | PurchaseOrderDetailID | int NOT NULL IDENTITY | Primary key. One line number per purchased product. |
| * | DueDate | datetime NOT NULL | Date the product is expected to be received. |
| * | OrderQty | smallint NOT NULL | Quantity ordered. |
| * | ProductID | int NOT NULL | Product identification number. Foreign key to Product.ProductID. |
| * | UnitPrice | money NOT NULL | Vendor's selling price of a single product. |
| LineTotal | text | Per product subtotal. Computed as OrderQty * UnitPrice. | |
| * | ReceivedQty | decimal(8,2) NOT NULL | Quantity actually received from the vendor. |
| * | RejectedQty | decimal(8,2) NOT NULL | Quantity rejected during inspection. |
| StockedQty | text | Quantity accepted into inventory. Computed as ReceivedQty - RejectedQty. | |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_PurchaseOrderDetail_Product_ProductID | ProductID ↗ ❏ Production.Product | ||
| FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID | PurchaseOrderID ↗ ❏ Purchasing.PurchaseOrderHeader | ||
| Constraints | |||
| CK_PurchaseOrderDetail_OrderQty | [OrderQty]>(0) | ||
| CK_PurchaseOrderDetail_UnitPrice | [UnitPrice]>=(0.00) | ||
| CK_PurchaseOrderDetail_ReceivedQty | [ReceivedQty]>=(0.00) | ||
| CK_PurchaseOrderDetail_RejectedQty | [RejectedQty]>=(0.00) | ||
| Triggers | |||
General purchase order information. See PurchaseOrderDetail.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | PurchaseOrderID | int NOT NULL IDENTITY | Primary key. |
| * | RevisionNumber | tinyint NOT NULL DEFAULT 0 | Incremental number to track changes to the purchase order over time. |
| * | Status | tinyint NOT NULL DEFAULT 1 | Order current status. 1 = Pending; 2 = Approved; 3 = Rejected; 4 = Complete |
| * | EmployeeID | int NOT NULL | Employee who created the purchase order. Foreign key to Employee.BusinessEntityID. |
| * | VendorID | int NOT NULL | Vendor with whom the purchase order is placed. Foreign key to Vendor.BusinessEntityID. |
| * | ShipMethodID | int NOT NULL | Shipping method. Foreign key to ShipMethod.ShipMethodID. |
| * | OrderDate | datetime NOT NULL DEFAULT getdate() | Purchase order creation date. |
| ShipDate | datetime | Estimated shipment date from the vendor. | |
| * | SubTotal | money NOT NULL DEFAULT 0.00 | Purchase order subtotal. Computed as SUM(PurchaseOrderDetail.LineTotal)for the appropriate PurchaseOrderID. |
| * | TaxAmt | money NOT NULL DEFAULT 0.00 | Tax amount. |
| * | Freight | money NOT NULL DEFAULT 0.00 | Shipping cost. |
| TotalDue | text | Total due to vendor. Computed as Subtotal + TaxAmt + Freight. | |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_PurchaseOrderHeader_Employee_EmployeeID | EmployeeID ↗ ❏ HumanResources.Employee(BusinessEntityID) | ||
| FK_PurchaseOrderHeader_ShipMethod_ShipMethodID | ShipMethodID ↗ ❏ Purchasing.ShipMethod | ||
| FK_PurchaseOrderHeader_Vendor_VendorID | VendorID ↗ ❏ Purchasing.Vendor(BusinessEntityID) | ||
| Referring Foreign Key | |||
| FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID | PurchaseOrderID ↙ ❏ Purchasing.PurchaseOrderDetail | ||
| Constraints | |||
| CK_PurchaseOrderHeader_Status | [Status]>=(1) AND [Status]<=(4) | ||
| CK_PurchaseOrderHeader_ShipDate | [ShipDate]>=[OrderDate] OR [ShipDate] IS NULL | ||
| CK_PurchaseOrderHeader_SubTotal | [SubTotal]>=(0.00) | ||
| CK_PurchaseOrderHeader_TaxAmt | [TaxAmt]>=(0.00) | ||
| CK_PurchaseOrderHeader_Freight | [Freight]>=(0.00) | ||
| Triggers | |||
Shipping company lookup table.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | ShipMethodID | int NOT NULL IDENTITY | Primary key for ShipMethod records. |
| * | Name | Purchasing.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Shipping company name. |
| * | ShipBase | money NOT NULL DEFAULT 0.00 | Minimum shipping charge. |
| * | ShipRate | money NOT NULL DEFAULT 0.00 | Shipping charge per pound. |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Referring Foreign Key | |||
| FK_PurchaseOrderHeader_ShipMethod_ShipMethodID | ShipMethodID ↙ ❏ Purchasing.PurchaseOrderHeader | ||
| FK_SalesOrderHeader_ShipMethod_ShipMethodID | ShipMethodID ↙ ❏ Sales.SalesOrderHeader | ||
| Constraints | |||
| CK_ShipMethod_ShipBase | [ShipBase]>(0.00) | ||
| CK_ShipMethod_ShipRate | [ShipRate]>(0.00) | ||
Companies from whom Adventure Works Cycles purchases parts or other goods.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | BusinessEntityID | int NOT NULL | Primary key for Vendor records. Foreign key to BusinessEntity.BusinessEntityID |
| * | AccountNumber | Purchasing.AccountNumber NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Vendor account (identification) number. |
| * | Name | Purchasing.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Company name. |
| * | CreditRating | tinyint NOT NULL | 1 = Superior, 2 = Excellent, 3 = Above average, 4 = Average, 5 = Below average |
| * | PreferredVendorStatus | Purchasing.Flag NOT NULL DEFAULT ((1)) | 0 = Do not use if another vendor is available. 1 = Preferred over other vendors supplying the same product. |
| * | ActiveFlag | Purchasing.Flag NOT NULL DEFAULT ((1)) | 0 = Vendor no longer used. 1 = Vendor is actively used. |
| PurchasingWebServiceURL | nvarchar(1024) COLLATE SQL_Latin1_General_CP1_CI_AS | ||
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | |
| Foreign Key | |||
| FK_Vendor_BusinessEntity_BusinessEntityID | BusinessEntityID ↗ ❏ Person.BusinessEntity | ||
| Referring Foreign Key | |||
| FK_ProductVendor_Vendor_BusinessEntityID | BusinessEntityID ↙ ❏ Purchasing.ProductVendor | ||
| FK_PurchaseOrderHeader_Vendor_VendorID | BusinessEntityID ↙ ❏ Purchasing.PurchaseOrderHeader(VendorID) | ||
| Constraints | |||
| CK_Vendor_CreditRating | [CreditRating]>=(1) AND [CreditRating]<=(5) | ||
| Triggers | |||
Cross-reference table mapping ISO currency codes to a country or region.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | CountryRegionCode | nvarchar(3) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | ISO code for countries and regions. Foreign key to CountryRegion.CountryRegionCode. |
| * | CurrencyCode | nchar(3) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | ISO standard currency code. Foreign key to Currency.CurrencyCode. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_CountryRegionCurrency_CountryRegion_CountryRegionCode | CountryRegionCode ↗ ❏ Person.CountryRegion | ||
| FK_CountryRegionCurrency_Currency_CurrencyCode | CurrencyCode ↗ ❏ Sales.Currency | ||
Customer credit card information.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | CreditCardID | int NOT NULL IDENTITY | Primary key for CreditCard records. |
| * | CardType | nvarchar(50) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Credit card name. |
| * | CardNumber | nvarchar(25) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Credit card number. |
| * | ExpMonth | tinyint NOT NULL | Credit card expiration month. |
| * | ExpYear | smallint NOT NULL | Credit card expiration year. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Referring Foreign Key | |||
| FK_PersonCreditCard_CreditCard_CreditCardID | CreditCardID ↙ ❏ Sales.PersonCreditCard | ||
| FK_SalesOrderHeader_CreditCard_CreditCardID | CreditCardID ↙ ❏ Sales.SalesOrderHeader | ||
Lookup table containing standard ISO currencies.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | CurrencyCode | nchar(3) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | The ISO code for the Currency. |
| * | Name | Sales.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Currency name. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Referring Foreign Key | |||
| FK_CountryRegionCurrency_Currency_CurrencyCode | CurrencyCode ↙ ❏ Sales.CountryRegionCurrency | ||
| FK_CurrencyRate_Currency_FromCurrencyCode | CurrencyCode ↙ ❏ Sales.CurrencyRate(FromCurrencyCode) | ||
| FK_CurrencyRate_Currency_ToCurrencyCode | CurrencyCode ↙ ❏ Sales.CurrencyRate(ToCurrencyCode) | ||
Currency exchange rates.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | CurrencyRateID | int NOT NULL IDENTITY | Primary key for CurrencyRate records. |
| * | CurrencyRateDate | datetime NOT NULL | Date and time the exchange rate was obtained. |
| * | FromCurrencyCode | nchar(3) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Exchange rate was converted from this currency code. |
| * | ToCurrencyCode | nchar(3) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Exchange rate was converted to this currency code. |
| * | AverageRate | money NOT NULL | Average exchange rate for the day. |
| * | EndOfDayRate | money NOT NULL | Final exchange rate for the day. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_CurrencyRate_Currency_FromCurrencyCode | FromCurrencyCode ↗ ❏ Sales.Currency(CurrencyCode) | ||
| FK_CurrencyRate_Currency_ToCurrencyCode | ToCurrencyCode ↗ ❏ Sales.Currency(CurrencyCode) | ||
| Referring Foreign Key | |||
| FK_SalesOrderHeader_CurrencyRate_CurrencyRateID | CurrencyRateID ↙ ❏ Sales.SalesOrderHeader | ||
Current customer information. Also see the Person and Store tables.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | CustomerID | int NOT NULL IDENTITY | Primary key. |
| PersonID | int | Foreign key to Person.BusinessEntityID | |
| StoreID | int | Foreign key to Store.BusinessEntityID | |
| TerritoryID | int | ID of the territory in which the customer is located. Foreign key to SalesTerritory.SalesTerritoryID. | |
| AccountNumber | text COLLATE SQL_Latin1_General_CP1_CI_AS | Unique number identifying the customer assigned by the accounting system. | |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_Customer_Person_PersonID | PersonID ↗ ❏ Person.Person(BusinessEntityID) | ||
| FK_Customer_SalesTerritory_TerritoryID | TerritoryID ↗ ❏ Sales.SalesTerritory | ||
| FK_Customer_Store_StoreID | StoreID ↗ ❏ Sales.Store(BusinessEntityID) | ||
| Referring Foreign Key | |||
| FK_SalesOrderHeader_Customer_CustomerID | CustomerID ↙ ❏ Sales.SalesOrderHeader | ||
Cross-reference table mapping people to their credit card information in the CreditCard table.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | BusinessEntityID | int NOT NULL | Business entity identification number. Foreign key to Person.BusinessEntityID. |
| * | CreditCardID | int NOT NULL | Credit card identification number. Foreign key to CreditCard.CreditCardID. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_PersonCreditCard_CreditCard_CreditCardID | CreditCardID ↗ ❏ Sales.CreditCard | ||
| FK_PersonCreditCard_Person_BusinessEntityID | BusinessEntityID ↗ ❏ Person.Person | ||
Individual products associated with a specific sales order. See SalesOrderHeader.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | SalesOrderID | int NOT NULL | Primary key. Foreign key to SalesOrderHeader.SalesOrderID. |
| * | SalesOrderDetailID | int NOT NULL IDENTITY | Primary key. One incremental unique number per product sold. |
| CarrierTrackingNumber | nvarchar(25) COLLATE SQL_Latin1_General_CP1_CI_AS | Shipment tracking number supplied by the shipper. | |
| * | OrderQty | smallint NOT NULL | Quantity ordered per product. |
| * | ProductID | int NOT NULL | Product sold to customer. Foreign key to Product.ProductID. |
| * | SpecialOfferID | int NOT NULL | Promotional code. Foreign key to SpecialOffer.SpecialOfferID. |
| * | UnitPrice | money NOT NULL | Selling price of a single product. |
| * | UnitPriceDiscount | money NOT NULL DEFAULT 0.0 | Discount amount. |
| LineTotal | text | Per product subtotal. Computed as UnitPrice * (1 - UnitPriceDiscount) * OrderQty. | |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID | SalesOrderID ↗ ❏ Sales.SalesOrderHeader on delete cascade | ||
| FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID | SpecialOfferID, ProductID ↗ ❏ Sales.SpecialOfferProduct | ||
| Constraints | |||
| CK_SalesOrderDetail_OrderQty | [OrderQty]>(0) | ||
| CK_SalesOrderDetail_UnitPrice | [UnitPrice]>=(0.00) | ||
| CK_SalesOrderDetail_UnitPriceDiscount | [UnitPriceDiscount]>=(0.00) | ||
| Triggers | |||
General sales order information.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | SalesOrderID | int NOT NULL IDENTITY | Primary key. |
| * | RevisionNumber | tinyint NOT NULL DEFAULT 0 | Incremental number to track changes to the sales order over time. |
| * | OrderDate | datetime NOT NULL DEFAULT getdate() | Dates the sales order was created. |
| * | DueDate | datetime NOT NULL | Date the order is due to the customer. |
| ShipDate | datetime | Date the order was shipped to the customer. | |
| * | Status | tinyint NOT NULL DEFAULT 1 | Order current status. 1 = In process; 2 = Approved; 3 = Backordered; 4 = Rejected; 5 = Shipped; 6 = Cancelled |
| * | OnlineOrderFlag | Sales.Flag NOT NULL DEFAULT ((1)) | 0 = Order placed by sales person. 1 = Order placed online by customer. |
| SalesOrderNumber | text COLLATE SQL_Latin1_General_CP1_CI_AS | Unique sales order identification number. | |
| PurchaseOrderNumber | Sales.OrderNumber COLLATE SQL_Latin1_General_CP1_CI_AS | Customer purchase order number reference. | |
| AccountNumber | Sales.AccountNumber COLLATE SQL_Latin1_General_CP1_CI_AS | Financial accounting number reference. | |
| * | CustomerID | int NOT NULL | Customer identification number. Foreign key to Customer.BusinessEntityID. |
| SalesPersonID | int | Sales person who created the sales order. Foreign key to SalesPerson.BusinessEntityID. | |
| TerritoryID | int | Territory in which the sale was made. Foreign key to SalesTerritory.SalesTerritoryID. | |
| * | BillToAddressID | int NOT NULL | Customer billing address. Foreign key to Address.AddressID. |
| * | ShipToAddressID | int NOT NULL | Customer shipping address. Foreign key to Address.AddressID. |
| * | ShipMethodID | int NOT NULL | Shipping method. Foreign key to ShipMethod.ShipMethodID. |
| CreditCardID | int | Credit card identification number. Foreign key to CreditCard.CreditCardID. | |
| CreditCardApprovalCode | varchar(15) COLLATE SQL_Latin1_General_CP1_CI_AS | Approval code provided by the credit card company. | |
| CurrencyRateID | int | Currency exchange rate used. Foreign key to CurrencyRate.CurrencyRateID. | |
| * | SubTotal | money NOT NULL DEFAULT 0.00 | Sales subtotal. Computed as SUM(SalesOrderDetail.LineTotal)for the appropriate SalesOrderID. |
| * | TaxAmt | money NOT NULL DEFAULT 0.00 | Tax amount. |
| * | Freight | money NOT NULL DEFAULT 0.00 | Shipping cost. |
| TotalDue | text | Total due from customer. Computed as Subtotal + TaxAmt + Freight. | |
| Comment | nvarchar(128) COLLATE SQL_Latin1_General_CP1_CI_AS | Sales representative comments. | |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_SalesOrderHeader_Address_BillToAddressID | BillToAddressID ↗ ❏ Person.Address(AddressID) | ||
| FK_SalesOrderHeader_Address_ShipToAddressID | ShipToAddressID ↗ ❏ Person.Address(AddressID) | ||
| FK_SalesOrderHeader_CreditCard_CreditCardID | CreditCardID ↗ ❏ Sales.CreditCard | ||
| FK_SalesOrderHeader_CurrencyRate_CurrencyRateID | CurrencyRateID ↗ ❏ Sales.CurrencyRate | ||
| FK_SalesOrderHeader_Customer_CustomerID | CustomerID ↗ ❏ Sales.Customer | ||
| FK_SalesOrderHeader_SalesPerson_SalesPersonID | SalesPersonID ↗ ❏ Sales.SalesPerson(BusinessEntityID) | ||
| FK_SalesOrderHeader_SalesTerritory_TerritoryID | TerritoryID ↗ ❏ Sales.SalesTerritory | ||
| FK_SalesOrderHeader_ShipMethod_ShipMethodID | ShipMethodID ↗ ❏ Purchasing.ShipMethod | ||
| Referring Foreign Key | |||
| FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID | SalesOrderID ↙ ❏ Sales.SalesOrderDetail | ||
| FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID | SalesOrderID ↙ ❏ Sales.SalesOrderHeaderSalesReason | ||
| Constraints | |||
| CK_SalesOrderHeader_Status | [Status]>=(0) AND [Status]<=(8) | ||
| CK_SalesOrderHeader_DueDate | [DueDate]>=[OrderDate] | ||
| CK_SalesOrderHeader_ShipDate | [ShipDate]>=[OrderDate] OR [ShipDate] IS NULL | ||
| CK_SalesOrderHeader_SubTotal | [SubTotal]>=(0.00) | ||
| CK_SalesOrderHeader_TaxAmt | [TaxAmt]>=(0.00) | ||
| CK_SalesOrderHeader_Freight | [Freight]>=(0.00) | ||
| Triggers | |||
Cross-reference table mapping sales orders to sales reason codes.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | SalesOrderID | int NOT NULL | Primary key. Foreign key to SalesOrderHeader.SalesOrderID. |
| * | SalesReasonID | int NOT NULL | Primary key. Foreign key to SalesReason.SalesReasonID. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID | SalesOrderID ↗ ❏ Sales.SalesOrderHeader on delete cascade | ||
| FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID | SalesReasonID ↗ ❏ Sales.SalesReason | ||
Sales representative current information.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | BusinessEntityID | int NOT NULL | Primary key for SalesPerson records. Foreign key to Employee.BusinessEntityID |
| TerritoryID | int | Territory currently assigned to. Foreign key to SalesTerritory.SalesTerritoryID. | |
| SalesQuota | money | Projected yearly sales. | |
| * | Bonus | money NOT NULL DEFAULT 0.00 | Bonus due if quota is met. |
| * | CommissionPct | smallmoney NOT NULL DEFAULT 0.00 | Commision percent received per sale. |
| * | SalesYTD | money NOT NULL DEFAULT 0.00 | Sales total year to date. |
| * | SalesLastYear | money NOT NULL DEFAULT 0.00 | Sales total of previous year. |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_SalesPerson_Employee_BusinessEntityID | BusinessEntityID ↗ ❏ HumanResources.Employee | ||
| FK_SalesPerson_SalesTerritory_TerritoryID | TerritoryID ↗ ❏ Sales.SalesTerritory | ||
| Referring Foreign Key | |||
| FK_SalesOrderHeader_SalesPerson_SalesPersonID | BusinessEntityID ↙ ❏ Sales.SalesOrderHeader(SalesPersonID) | ||
| FK_SalesPersonQuotaHistory_SalesPerson_BusinessEntityID | BusinessEntityID ↙ ❏ Sales.SalesPersonQuotaHistory | ||
| FK_SalesTerritoryHistory_SalesPerson_BusinessEntityID | BusinessEntityID ↙ ❏ Sales.SalesTerritoryHistory | ||
| FK_Store_SalesPerson_SalesPersonID | BusinessEntityID ↙ ❏ Sales.Store(SalesPersonID) | ||
| Constraints | |||
| CK_SalesPerson_SalesQuota | [SalesQuota]>(0.00) | ||
| CK_SalesPerson_Bonus | [Bonus]>=(0.00) | ||
| CK_SalesPerson_CommissionPct | [CommissionPct]>=(0.00) | ||
| CK_SalesPerson_SalesYTD | [SalesYTD]>=(0.00) | ||
| CK_SalesPerson_SalesLastYear | [SalesLastYear]>=(0.00) | ||
Sales performance tracking.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | BusinessEntityID | int NOT NULL | Sales person identification number. Foreign key to SalesPerson.BusinessEntityID. |
| * | QuotaDate | datetime NOT NULL | Sales quota date. |
| * | SalesQuota | money NOT NULL | Sales quota amount. |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_SalesPersonQuotaHistory_SalesPerson_BusinessEntityID | BusinessEntityID ↗ ❏ Sales.SalesPerson | ||
| Constraints | |||
| CK_SalesPersonQuotaHistory_SalesQuota | [SalesQuota]>(0.00) | ||
Lookup table of customer purchase reasons.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | SalesReasonID | int NOT NULL IDENTITY | Primary key for SalesReason records. |
| * | Name | Sales.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Sales reason description. |
| * | ReasonType | Sales.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Category the sales reason belongs to. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Referring Foreign Key | |||
| FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID | SalesReasonID ↙ ❏ Sales.SalesOrderHeaderSalesReason | ||
Tax rate lookup table.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | SalesTaxRateID | int NOT NULL IDENTITY | Primary key for SalesTaxRate records. |
| * | StateProvinceID | int NOT NULL | State, province, or country/region the sales tax applies to. |
| * | TaxType | tinyint NOT NULL | 1 = Tax applied to retail transactions, 2 = Tax applied to wholesale transactions, 3 = Tax applied to all sales (retail and wholesale) transactions. |
| * | TaxRate | smallmoney NOT NULL DEFAULT 0.00 | Tax rate amount. |
| * | Name | Sales.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Tax rate description. |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_SalesTaxRate_StateProvince_StateProvinceID | StateProvinceID ↗ ❏ Person.StateProvince | ||
| Constraints | |||
| CK_SalesTaxRate_TaxType | [TaxType]>=(1) AND [TaxType]<=(3) | ||
Sales territory lookup table.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | TerritoryID | int NOT NULL IDENTITY | Primary key for SalesTerritory records. |
| * | Name | Sales.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Sales territory description |
| * | CountryRegionCode | nvarchar(3) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode. |
| * | Group | nvarchar(50) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Geographic area to which the sales territory belong. |
| * | SalesYTD | money NOT NULL DEFAULT 0.00 | Sales in the territory year to date. |
| * | SalesLastYear | money NOT NULL DEFAULT 0.00 | Sales in the territory the previous year. |
| * | CostYTD | money NOT NULL DEFAULT 0.00 | Business costs in the territory year to date. |
| * | CostLastYear | money NOT NULL DEFAULT 0.00 | Business costs in the territory the previous year. |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_SalesTerritory_CountryRegion_CountryRegionCode | CountryRegionCode ↗ ❏ Person.CountryRegion | ||
| Referring Foreign Key | |||
| FK_StateProvince_SalesTerritory_TerritoryID | TerritoryID ↙ ❏ Person.StateProvince | ||
| FK_Customer_SalesTerritory_TerritoryID | TerritoryID ↙ ❏ Sales.Customer | ||
| FK_SalesOrderHeader_SalesTerritory_TerritoryID | TerritoryID ↙ ❏ Sales.SalesOrderHeader | ||
| FK_SalesPerson_SalesTerritory_TerritoryID | TerritoryID ↙ ❏ Sales.SalesPerson | ||
| FK_SalesTerritoryHistory_SalesTerritory_TerritoryID | TerritoryID ↙ ❏ Sales.SalesTerritoryHistory | ||
| Constraints | |||
| CK_SalesTerritory_SalesYTD | [SalesYTD]>=(0.00) | ||
| CK_SalesTerritory_SalesLastYear | [SalesLastYear]>=(0.00) | ||
| CK_SalesTerritory_CostYTD | [CostYTD]>=(0.00) | ||
| CK_SalesTerritory_CostLastYear | [CostLastYear]>=(0.00) | ||
Sales representative transfers to other sales territories.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | BusinessEntityID | int NOT NULL | Primary key. The sales rep. Foreign key to SalesPerson.BusinessEntityID. |
| * | TerritoryID | int NOT NULL | Primary key. Territory identification number. Foreign key to SalesTerritory.SalesTerritoryID. |
| * | StartDate | datetime NOT NULL | Primary key. Date the sales representive started work in the territory. |
| EndDate | datetime | Date the sales representative left work in the territory. | |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_SalesTerritoryHistory_SalesPerson_BusinessEntityID | BusinessEntityID ↗ ❏ Sales.SalesPerson | ||
| FK_SalesTerritoryHistory_SalesTerritory_TerritoryID | TerritoryID ↗ ❏ Sales.SalesTerritory | ||
| Constraints | |||
| CK_SalesTerritoryHistory_EndDate | [EndDate]>=[StartDate] OR [EndDate] IS NULL | ||
Contains online customer orders until the order is submitted or cancelled.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | ShoppingCartItemID | int NOT NULL IDENTITY | Primary key for ShoppingCartItem records. |
| * | ShoppingCartID | nvarchar(50) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Shopping cart identification number. |
| * | Quantity | int NOT NULL DEFAULT 1 | Product quantity ordered. |
| * | ProductID | int NOT NULL | Product ordered. Foreign key to Product.ProductID. |
| * | DateCreated | datetime NOT NULL DEFAULT getdate() | Date the time the record was created. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_ShoppingCartItem_Product_ProductID | ProductID ↗ ❏ Production.Product | ||
| Constraints | |||
| CK_ShoppingCartItem_Quantity | [Quantity]>=(1) | ||
Sale discounts lookup table.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | SpecialOfferID | int NOT NULL IDENTITY | Primary key for SpecialOffer records. |
| * | Description | nvarchar(255) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Discount description. |
| * | DiscountPct | smallmoney NOT NULL DEFAULT 0.00 | Discount precentage. |
| * | Type | nvarchar(50) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Discount type category. |
| * | Category | nvarchar(50) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Group the discount applies to such as Reseller or Customer. |
| * | StartDate | datetime NOT NULL | Discount start date. |
| * | EndDate | datetime NOT NULL | Discount end date. |
| * | MinQty | int NOT NULL DEFAULT 0 | Minimum discount percent allowed. |
| MaxQty | int | Maximum discount percent allowed. | |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Referring Foreign Key | |||
| FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID | SpecialOfferID ↙ ❏ Sales.SpecialOfferProduct | ||
| Constraints | |||
| CK_SpecialOffer_EndDate | [EndDate]>=[StartDate] | ||
| CK_SpecialOffer_DiscountPct | [DiscountPct]>=(0.00) | ||
| CK_SpecialOffer_MinQty | [MinQty]>=(0) | ||
| CK_SpecialOffer_MaxQty | [MaxQty]>=(0) | ||
Cross-reference table mapping products to special offer discounts.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | SpecialOfferID | int NOT NULL | Primary key for SpecialOfferProduct records. |
| * | ProductID | int NOT NULL | Product identification number. Foreign key to Product.ProductID. |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_SpecialOfferProduct_Product_ProductID | ProductID ↗ ❏ Production.Product | ||
| FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID | SpecialOfferID ↗ ❏ Sales.SpecialOffer | ||
| Referring Foreign Key | |||
| FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID | SpecialOfferID, ProductID ↙ ❏ Sales.SalesOrderDetail | ||
Customers (resellers) of Adventure Works products.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | BusinessEntityID | int NOT NULL | Primary key. Foreign key to Customer.BusinessEntityID. |
| * | Name | Sales.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Name of the store. |
| SalesPersonID | int | ID of the sales person assigned to the customer. Foreign key to SalesPerson.BusinessEntityID. | |
| Demographics | xml | Demographic informationg about the store such as the number of employees, annual sales and store type. | |
| * | rowguid | uniqueidentifier NOT NULL DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
| Foreign Key | |||
| FK_Store_BusinessEntity_BusinessEntityID | BusinessEntityID ↗ ❏ Person.BusinessEntity | ||
| FK_Store_SalesPerson_SalesPersonID | SalesPersonID ↗ ❏ Sales.SalesPerson(BusinessEntityID) | ||
| Referring Foreign Key | |||
| FK_Customer_Store_StoreID | BusinessEntityID ↙ ❏ Sales.Customer(StoreID) | ||
Current version number of the AdventureWorks 2025 sample database.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | SystemInformationID | tinyint NOT NULL IDENTITY | Primary key for AWBuildVersion records. |
| * | Database Version | nvarchar(25) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | Version number of the database in 9.yy.mm.dd.00 format. |
| * | VersionDate | datetime NOT NULL | Date and time the record was last updated. |
| * | ModifiedDate | datetime NOT NULL DEFAULT getdate() | Date and time the record was last updated. |
Audit table tracking all DDL changes made to the AdventureWorks database. Data is captured by the database trigger ddlDatabaseTriggerLog.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | DatabaseLogID | int NOT NULL IDENTITY | Primary key for DatabaseLog records. |
| * | PostTime | datetime NOT NULL | The date and time the DDL change occurred. |
| * | DatabaseUser | sysname NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | The user who implemented the DDL change. |
| * | Event | sysname NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | The type of DDL statement that was executed. |
| Schema | sysname COLLATE SQL_Latin1_General_CP1_CI_AS | The schema to which the changed object belongs. | |
| Object | sysname COLLATE SQL_Latin1_General_CP1_CI_AS | The object that was changed by the DDL statment. | |
| * | TSQL | nvarchar(max) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | The exact Transact-SQL statement that was executed. |
| * | XmlEvent | xml NOT NULL | The raw XML data generated by database trigger. |
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.
| Idx | Column Name | Definition | Description |
|---|---|---|---|
| * | ErrorLogID | int NOT NULL IDENTITY | Primary key for ErrorLog records. |
| * | ErrorTime | datetime NOT NULL DEFAULT getdate() | The date and time at which the error occurred. |
| * | UserName | sysname NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | The user who executed the batch in which the error occurred. |
| * | ErrorNumber | int NOT NULL | The error number of the error that occurred. |
| ErrorSeverity | int | The severity of the error that occurred. | |
| ErrorState | int | The state number of the error that occurred. | |
| ErrorProcedure | nvarchar(126) COLLATE SQL_Latin1_General_CP1_CI_AS | The name of the stored procedure or trigger where the error occurred. | |
| ErrorLine | int | The line number at which the error occurred. | |
| * | ErrorMessage | nvarchar(4000) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS | The message text of the error that occurred. |