Dashboards


Parameters
SeqParameter NameParameter Value
0TimeDec 24 2008  2:39:38:560PM
10DatabaseAdventureWorks
20Procedure Filter%
30Function Filter%
40Table Filter%
50View Filter%
60Trigger Filter%
70Index Filter%
Object Distribution
Top Tables by Rows
Top Tables by Size
Tables
Table NameTable Schema
AWBuildVersiondbo
DatabaseLogdbo
ErrorLogdbo
DepartmentHumanResources
EmployeeHumanResources
EmployeeAddressHumanResources
EmployeeDepartmentHistoryHumanResources
EmployeePayHistoryHumanResources
JobCandidateHumanResources
ShiftHumanResources
AddressPerson
AddressTypePerson
ContactPerson
ContactTypePerson
CountryRegionPerson
StateProvincePerson
BillOfMaterialsProduction
CultureProduction
DocumentProduction
IllustrationProduction
LocationProduction
ProductProduction
ProductCategoryProduction
ProductCostHistoryProduction
ProductDescriptionProduction
ProductDocumentProduction
ProductInventoryProduction
ProductListPriceHistoryProduction
ProductModelProduction
ProductModelIllustrationProduction
ProductModelProductDescriptionCultureProduction
ProductPhotoProduction
ProductProductPhotoProduction
ProductReviewProduction
ProductSubcategoryProduction
ScrapReasonProduction
TransactionHistoryProduction
TransactionHistoryArchiveProduction
UnitMeasureProduction
WorkOrderProduction
WorkOrderRoutingProduction
ProductVendorPurchasing
PurchaseOrderDetailPurchasing
PurchaseOrderHeaderPurchasing
ShipMethodPurchasing
VendorPurchasing
VendorAddressPurchasing
VendorContactPurchasing
ContactCreditCardSales
CountryRegionCurrencySales
CreditCardSales
CurrencySales
CurrencyRateSales
CustomerSales
CustomerAddressSales
IndividualSales
SalesOrderDetailSales
SalesOrderHeaderSales
SalesOrderHeaderSalesReasonSales
SalesPersonSales
SalesPersonQuotaHistorySales
SalesReasonSales
SalesTaxRateSales
SalesTerritorySales
SalesTerritoryHistorySales
ShoppingCartItemSales
SpecialOfferSales
SpecialOfferProductSales
StoreSales
StoreContactSales
AWBuildVersion
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
Database Versionnvarchar25 NOVersion number of the database in 9.yy.mm.dd.00 format.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
SystemInformationIDtinyint NOPrimary key for AWBuildVersion records.
SystemInformationIDtinyint NOClustered index created by a primary key constraint.
VersionDatedatetime NODate and time the record was last updated.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
AWBuildVersionPK_AWBuildVersion_SystemInformationIDSystemInformationIDCLUSTEREDtruetruefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
DatabaseLog
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
DatabaseLogIDint NOPrimary key for DatabaseLog records.
DatabaseUsernvarchar128 NOThe user who implemented the DDL change.
Eventnvarchar128 NOThe type of DDL statement that was executed.
Objectnvarchar128 YESThe object that was changed by the DDL statment.
PostTimedatetime NOThe date and time the DDL change occurred.
PostTimedatetime NONonclustered index created by a primary key constraint.
Schemanvarchar128 YESThe schema to which the changed object belongs.
TSQLnvarchar-1 NOThe exact Transact-SQL statement that was executed.
XmlEventxml-1 NOThe raw XML data generated by database trigger.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
DatabaseLogPK_DatabaseLog_DatabaseLogIDDatabaseLogIDNONCLUSTEREDtruetruefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
ErrorLog
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
ErrorLineint YESThe line number at which the error occurred.
ErrorLogIDint NOPrimary key for ErrorLog records.
ErrorLogIDint NOClustered index created by a primary key constraint.
ErrorMessagenvarchar4000 NOThe message text of the error that occurred.
ErrorNumberint NOThe error number of the error that occurred.
ErrorProcedurenvarchar126 YESThe name of the stored procedure or trigger where the error occurred.
ErrorSeverityint YESThe severity of the error that occurred.
ErrorStateint YESThe state number of the error that occurred.
ErrorTimedatetime (getdate())NOThe date and time at which the error occurred.
UserNamenvarchar128 NOThe user who executed the batch in which the error occurred.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
ErrorLogPK_ErrorLog_ErrorLogIDErrorLogIDCLUSTEREDtruetruefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
uspLogErrorSQL_STORED_PROCEDURE
Department
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
DepartmentIDsmallint NOPrimary key for Department records.
DepartmentIDsmallint NOClustered index created by a primary key constraint.
GroupNamenvarchar50 NOName of the group to which the department belongs.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Namenvarchar50 NOName of the department.
Namenvarchar50 NOUnique nonclustered index.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
DepartmentPK_Department_DepartmentIDDepartmentIDCLUSTEREDtruetruefalsefalsefalsefalse
DepartmentAK_Department_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
vEmployeeDepartmentVIEW
vEmployeeDepartmentHistoryVIEW
Employee
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
BirthDatedatetime NODate of birth.
ContactIDint NOIdentifies the employee in the Contact table. Foreign key to Contact.ContactID.
ContactIDint NOUnique nonclustered index.
CurrentFlagbit ((1))NO0 = Inactive, 1 = Active
EmployeeIDint NOPrimary key for Employee records.
EmployeeIDint NOClustered index created by a primary key constraint.
Gendernchar1 NOM = Male, F = Female
HireDatedatetime NOEmployee hired on this date.
LoginIDnvarchar256 NONetwork login.
LoginIDnvarchar256 NOUnique nonclustered index. Used to support replication samples.
ManagerIDint YESManager to whom the employee is assigned. Foreign Key to Employee.M
ManagerIDint YESNonclustered index.
MaritalStatusnchar1 NOM = Married, S = Single
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
NationalIDNumbernvarchar15 NOUnique national identification number such as a social security number.
NationalIDNumbernvarchar15 NOUnique nonclustered index.
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
SalariedFlagbit ((1))NOJob classification. 0 = Hourly, not exempt from collective bargaining. 1 = Salaried, exempt from collective bargaining.
SickLeaveHourssmallint ((0))NONumber of available sick leave hours.
Titlenvarchar50 NOWork title such as Buyer or Sales Representative.
VacationHourssmallint ((0))NONumber of available vacation hours.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
EmployeePK_Employee_EmployeeIDEmployeeIDCLUSTEREDtruetruefalsefalsefalsefalse
EmployeeAK_Employee_LoginIDLoginIDNONCLUSTEREDtruefalsefalsefalsefalsefalse
EmployeeAK_Employee_NationalIDNumberNationalIDNumberNONCLUSTEREDtruefalsefalsefalsefalsefalse
EmployeeAK_Employee_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
EmployeeIX_Employee_ManagerIDManagerIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
uspGetEmployeeManagersSQL_STORED_PROCEDURE
uspGetManagerEmployeesSQL_STORED_PROCEDURE
uspUpdateEmployeeHireInfoSQL_STORED_PROCEDURE
uspUpdateEmployeeLoginSQL_STORED_PROCEDURE
uspUpdateEmployeePersonalInfoSQL_STORED_PROCEDURE
ufnGetContactInformationSQL_TABLE_VALUED_FUNCTION
vEmployeeVIEW
vEmployeeDepartmentVIEW
vEmployeeDepartmentHistoryVIEW
vSalesPersonVIEW
vSalesPersonSalesByFiscalYearsVIEW
EmployeeAddress
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
AddressIDint NOPrimary key. Foreign key to Address.AddressID.
AddressIDint NOUnique nonclustered index. Used to support replication samples.
EmployeeIDint NOPrimary key. Foreign key to Employee.EmployeeID.
EmployeeIDint NOClustered index created by a primary key constraint.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
EmployeeAddressPK_EmployeeAddress_EmployeeID_AddressIDEmployeeIDCLUSTEREDtruetruefalsefalsefalsefalse
EmployeeAddressPK_EmployeeAddress_EmployeeID_AddressIDAddressIDCLUSTEREDtruetruefalsefalsefalsefalse
EmployeeAddressAK_EmployeeAddress_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
vEmployeeVIEW
vSalesPersonVIEW
EmployeeDepartmentHistory
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
DepartmentIDsmallint NODepartment in which the employee worked including currently. Foreign key to Department.DepartmentID.
DepartmentIDsmallint NONonclustered index.
EmployeeIDint NOEmployee identification number. Foreign key to Employee.EmployeeID.
EmployeeIDint NOClustered index created by a primary key constraint.
EndDatedatetime YESDate the employee left the department. NULL = Current department.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
ShiftIDtinyint NOIdentifies which 8-hour shift the employee works. Foreign key to Shift.Shift.ID.
ShiftIDtinyint NONonclustered index.
StartDatedatetime NODate the employee started work in the department.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
EmployeeDepartmentHistoryPK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentIDEmployeeIDCLUSTEREDtruetruefalsefalsefalsefalse
EmployeeDepartmentHistoryPK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentIDDepartmentIDCLUSTEREDtruetruefalsefalsefalsefalse
EmployeeDepartmentHistoryPK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentIDShiftIDCLUSTEREDtruetruefalsefalsefalsefalse
EmployeeDepartmentHistoryPK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentIDStartDateCLUSTEREDtruetruefalsefalsefalsefalse
EmployeeDepartmentHistoryIX_EmployeeDepartmentHistory_DepartmentIDDepartmentIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
EmployeeDepartmentHistoryIX_EmployeeDepartmentHistory_ShiftIDShiftIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
vEmployeeDepartmentVIEW
vEmployeeDepartmentHistoryVIEW
EmployeePayHistory
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
EmployeeIDint NOEmployee identification number. Foreign key to Employee.EmployeeID.
EmployeeIDint NOClustered index created by a primary key constraint.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
PayFrequencytinyint NO1 = Salary received monthly, 2 = Salary received biweekly
Ratemoney NOSalary hourly rate.
RateChangeDatedatetime NODate the change in pay is effective
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
EmployeePayHistoryPK_EmployeePayHistory_EmployeeID_RateChangeDateEmployeeIDCLUSTEREDtruetruefalsefalsefalsefalse
EmployeePayHistoryPK_EmployeePayHistory_EmployeeID_RateChangeDateRateChangeDateCLUSTEREDtruetruefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
uspUpdateEmployeeHireInfoSQL_STORED_PROCEDURE
JobCandidate
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
EmployeeIDint YESEmployee identification number if applicant was hired. Foreign key to Employee.EmployeeID.
EmployeeIDint YESNonclustered index.
JobCandidateIDint NOPrimary key for JobCandidate records.
JobCandidateIDint NOClustered index created by a primary key constraint.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Resumexml-1 YESRésumé in XML format.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
JobCandidatePK_JobCandidate_JobCandidateIDJobCandidateIDCLUSTEREDtruetruefalsefalsefalsefalse
JobCandidateIX_JobCandidate_EmployeeIDEmployeeIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
vJobCandidateVIEW
vJobCandidateEducationVIEW
vJobCandidateEmploymentVIEW
Shift
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
EndTimedatetime NOShift end time.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Namenvarchar50 NOShift description.
Namenvarchar50 NOUnique nonclustered index.
ShiftIDtinyint NOPrimary key for Shift records.
ShiftIDtinyint NOClustered index created by a primary key constraint.
StartTimedatetime NOShift start time.
StartTimedatetime NOUnique nonclustered index.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
ShiftPK_Shift_ShiftIDShiftIDCLUSTEREDtruetruefalsefalsefalsefalse
ShiftAK_Shift_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
ShiftAK_Shift_StartTime_EndTimeStartTimeNONCLUSTEREDtruefalsefalsefalsefalsefalse
ShiftAK_Shift_StartTime_EndTimeEndTimeNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
vEmployeeDepartmentHistoryVIEW
Address
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
AddressIDint NOPrimary key for Address records.
AddressIDint NOClustered index created by a primary key constraint.
AddressLine1nvarchar60 NOFirst street address line.
AddressLine1nvarchar60 NOUnique nonclustered index. Used to support replication samples.
AddressLine2nvarchar60 YESSecond street address line.
AddressLine2nvarchar60 YESNonclustered index.
Citynvarchar30 NOName of the city.
Citynvarchar30 NONonclustered index.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
PostalCodenvarchar15 NOPostal code for the street address.
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
StateProvinceIDint NOUnique identification number for the state or province. Foreign key to StateProvince table.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
AddressPK_Address_AddressIDAddressIDCLUSTEREDtruetruefalsefalsefalsefalse
AddressAK_Address_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
AddressIX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCodeAddressLine1NONCLUSTEREDtruefalsefalsefalsefalsefalse
AddressIX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCodeAddressLine2NONCLUSTEREDtruefalsefalsefalsefalsefalse
AddressIX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCodeCityNONCLUSTEREDtruefalsefalsefalsefalsefalse
AddressIX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCodeStateProvinceIDNONCLUSTEREDtruefalsefalsefalsefalsefalse
AddressIX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCodePostalCodeNONCLUSTEREDtruefalsefalsefalsefalsefalse
AddressIX_Address_StateProvinceIDStateProvinceIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
vEmployeeVIEW
vIndividualCustomerVIEW
vSalesPersonVIEW
vStoreWithDemographicsVIEW
vVendorVIEW
AddressType
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
AddressTypeIDint NOPrimary key for AddressType records.
AddressTypeIDint NOClustered index created by a primary key constraint.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Namenvarchar50 NOAddress type description. For example, Billing, Home, or Shipping.
Namenvarchar50 NOUnique nonclustered index. Used to support replication samples.
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
rowguiduniqueidentifier (newid())NOUnique nonclustered index.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
AddressTypePK_AddressType_AddressTypeIDAddressTypeIDCLUSTEREDtruetruefalsefalsefalsefalse
AddressTypeAK_AddressType_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
AddressTypeAK_AddressType_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
vIndividualCustomerVIEW
vStoreWithDemographicsVIEW
Contact
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
AdditionalContactInfoxml-1 YESAdditional contact information about the person stored in xml format. 
ContactIDint NOPrimary key for Contact records.
ContactIDint NOClustered index created by a primary key constraint.
EmailAddressnvarchar50 YESE-mail address for the person.
EmailPromotionint ((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. 
FirstNamenvarchar50 NOFirst name of the person.
LastNamenvarchar50 NOLast name of the person.
MiddleNamenvarchar50 YESMiddle name or middle initial of the person.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
NameStylebit ((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.
NameStylebit ((0))NOUnique nonclustered index. Used to support replication samples.
PasswordHashvarchar128 NOPassword for the e-mail account.
PasswordSaltvarchar10 NORandom value concatenated with the password string before the password is hashed.
Phonenvarchar25 YESPhone number associated with the person.
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
Suffixnvarchar10 YESSurname suffix. For example, Sr. or Jr.
Titlenvarchar8 YESA courtesy title. For example, Mr. or Ms.
Titlenvarchar8 YESNonclustered index.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
ContactPK_Contact_ContactIDContactIDCLUSTEREDtruetruefalsefalsefalsefalse
ContactAK_Contact_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
ContactIX_Contact_EmailAddressEmailAddressNONCLUSTEREDfalsefalsefalsefalsefalsefalse
ContactPXML_Contact_AddContactAdditionalContactInfoXMLfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
uspGetEmployeeManagersSQL_STORED_PROCEDURE
uspGetManagerEmployeesSQL_STORED_PROCEDURE
ufnGetContactInformationSQL_TABLE_VALUED_FUNCTION
vAdditionalContactInfoVIEW
vEmployeeVIEW
vEmployeeDepartmentVIEW
vEmployeeDepartmentHistoryVIEW
vIndividualCustomerVIEW
vSalesPersonVIEW
vSalesPersonSalesByFiscalYearsVIEW
vStoreWithDemographicsVIEW
vVendorVIEW
ContactType
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
ContactTypeIDint NOPrimary key for ContactType records.
ContactTypeIDint NOClustered index created by a primary key constraint.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Namenvarchar50 NOContact type description.
Namenvarchar50 NOUnique nonclustered index.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
ContactTypePK_ContactType_ContactTypeIDContactTypeIDCLUSTEREDtruetruefalsefalsefalsefalse
ContactTypeAK_ContactType_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
ufnGetContactInformationSQL_TABLE_VALUED_FUNCTION
vStoreWithDemographicsVIEW
vVendorVIEW
CountryRegion
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
CountryRegionCodenvarchar3 NOISO standard code for countries and regions.
CountryRegionCodenvarchar3 NOClustered index created by a primary key constraint.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Namenvarchar50 NOCountry or region name.
Namenvarchar50 NOUnique nonclustered index.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
CountryRegionPK_CountryRegion_CountryRegionCodeCountryRegionCodeCLUSTEREDtruetruefalsefalsefalsefalse
CountryRegionAK_CountryRegion_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
vEmployeeVIEW
vIndividualCustomerVIEW
vSalesPersonVIEW
vStateProvinceCountryRegionVIEW
vStoreWithDemographicsVIEW
vVendorVIEW
StateProvince
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
CountryRegionCodenvarchar3 NOISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode. 
CountryRegionCodenvarchar3 NOUnique nonclustered index.
IsOnlyStateProvinceFlagbit ((1))NO0 = StateProvinceCode exists. 1 = StateProvinceCode unavailable, using CountryRegionCode.
IsOnlyStateProvinceFlagbit ((1))NOUnique nonclustered index. Used to support replication samples.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Namenvarchar50 NOState or province description.
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
StateProvinceCodenchar3 NOISO standard state or province code.
StateProvinceCodenchar3 NOUnique nonclustered index.
StateProvinceIDint NOPrimary key for StateProvince records.
StateProvinceIDint NOClustered index created by a primary key constraint.
TerritoryIDint NOID of the territory in which the state or province is located. Foreign key to SalesTerritory.SalesTerritoryID.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
StateProvincePK_StateProvince_StateProvinceIDStateProvinceIDCLUSTEREDtruetruefalsefalsefalsefalse
StateProvinceAK_StateProvince_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
StateProvinceAK_StateProvince_StateProvinceCode_CountryRegionCodeStateProvinceCodeNONCLUSTEREDtruefalsefalsefalsefalsefalse
StateProvinceAK_StateProvince_StateProvinceCode_CountryRegionCodeCountryRegionCodeNONCLUSTEREDtruefalsefalsefalsefalsefalse
StateProvinceAK_StateProvince_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
vEmployeeVIEW
vIndividualCustomerVIEW
vSalesPersonVIEW
vStateProvinceCountryRegionVIEW
vStoreWithDemographicsVIEW
vVendorVIEW
BillOfMaterials
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
BillOfMaterialsIDint NOPrimary key for BillOfMaterials records.
BillOfMaterialsIDint NOClustered index.
BOMLevelsmallint NOIndicates the depth the component is from its parent (AssemblyID).
ComponentIDint NOComponent identification number. Foreign key to Product.ProductID.
ComponentIDint NONonclustered index.
EndDatedatetime YESDate the component stopped being used in the assembly item.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
PerAssemblyQtydecimal ((1.00))NOQuantity of the component needed to create the assembly.
ProductAssemblyIDint YESParent product identification number. Foreign key to Product.ProductID.
ProductAssemblyIDint YESNonclustered index created by a primary key constraint.
StartDatedatetime (getdate())NODate the component started being used in the assembly item.
UnitMeasureCodenchar3 NOStandard code identifying the unit of measure for the quantity.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
BillOfMaterialsAK_BillOfMaterials_ProductAssemblyID_ComponentID_StartDateProductAssemblyIDCLUSTEREDtruefalsefalsefalsefalsefalse
BillOfMaterialsAK_BillOfMaterials_ProductAssemblyID_ComponentID_StartDateComponentIDCLUSTEREDtruefalsefalsefalsefalsefalse
BillOfMaterialsAK_BillOfMaterials_ProductAssemblyID_ComponentID_StartDateStartDateCLUSTEREDtruefalsefalsefalsefalsefalse
BillOfMaterialsPK_BillOfMaterials_BillOfMaterialsIDBillOfMaterialsIDNONCLUSTEREDtruetruefalsefalsefalsefalse
BillOfMaterialsIX_BillOfMaterials_UnitMeasureCodeUnitMeasureCodeNONCLUSTEREDfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
uspGetBillOfMaterialsSQL_STORED_PROCEDURE
uspGetWhereUsedProductIDSQL_STORED_PROCEDURE
Culture
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
CultureIDnchar6 NOPrimary key for Culture records.
CultureIDnchar6 NOClustered index created by a primary key constraint.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Namenvarchar50 NOCulture description.
Namenvarchar50 NOUnique nonclustered index.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
CulturePK_Culture_CultureIDCultureIDCLUSTEREDtruetruefalsefalsefalsefalse
CultureAK_Culture_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
Document
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
ChangeNumberint ((0))NOEngineering change approval number.
Documentvarbinary-1 YESComplete document.
DocumentIDint NOPrimary key for Document records.
DocumentIDint NOClustered index created by a primary key constraint.
DocumentSummarynvarchar-1 YESDocument abstract.
FileExtensionnvarchar8 NOFile extension indicating the document type. For example, .doc or .txt.
FileNamenvarchar400 NODirectory path and file name of the document
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Revisionnchar5 NORevision number of the document. 
Statustinyint NO1 = Pending approval, 2 = Approved, 3 = Obsolete
Titlenvarchar50 NOTitle of the document.
Titlenvarchar50 NOUnique nonclustered index.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
DocumentPK_Document_DocumentIDDocumentIDCLUSTEREDtruetruefalsefalsefalsefalse
DocumentAK_Document_FileName_RevisionFileNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
DocumentAK_Document_FileName_RevisionRevisionNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
Illustration
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
Diagramxml-1 YESIllustrations used in manufacturing instructions. Stored as XML.
IllustrationIDint NOPrimary key for Illustration records.
IllustrationIDint NOClustered index created by a primary key constraint.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
IllustrationPK_Illustration_IllustrationIDIllustrationIDCLUSTEREDtruetruefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
Location
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
Availabilitydecimal ((0.00))NOWork capacity (in hours) of the manufacturing location.
CostRatesmallmoney ((0.00))NOStandard hourly cost of the manufacturing location.
LocationIDsmallint NOPrimary key for Location records.
LocationIDsmallint NOClustered index created by a primary key constraint.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Namenvarchar50 NOLocation description.
Namenvarchar50 NOUnique nonclustered index.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
LocationPK_Location_LocationIDLocationIDCLUSTEREDtruetruefalsefalsefalsefalse
LocationAK_Location_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
Product
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
Classnchar2 YESH = High, M = Medium, L = Low
Colornvarchar15 YESProduct color.
DaysToManufactureint NONumber of days required to manufacture the product.
DiscontinuedDatedatetime YESDate the product was discontinued.
FinishedGoodsFlagbit ((1))NO0 = Product is not a salable item. 1 = Product is salable.
ListPricemoney NOSelling price.
MakeFlagbit ((1))NO0 = Product is purchased, 1 = Product is manufactured in-house.
MakeFlagbit ((1))NOUnique nonclustered index. Used to support replication samples.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Namenvarchar50 NOName of the product.
Namenvarchar50 NOUnique nonclustered index.
ProductIDint NOPrimary key for Product records.
ProductIDint NOClustered index created by a primary key constraint.
ProductLinenchar2 YESR = Road, M = Mountain, T = Touring, S = Standard
ProductModelIDint YESProduct is a member of this product model. Foreign key to ProductModel.ProductModelID.
ProductNumbernvarchar25 NOUnique product identification number.
ProductNumbernvarchar25 NOUnique nonclustered index.
ProductSubcategoryIDint YESProduct is a member of this product subcategory. Foreign key to ProductSubCategory.ProductSubCategoryID. 
ReorderPointsmallint NOInventory level that triggers a purchase order or work order. 
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
SafetyStockLevelsmallint NOMinimum inventory quantity. 
SellEndDatedatetime YESDate the product was no longer available for sale.
SellStartDatedatetime NODate the product was available for sale.
Sizenvarchar5 YESProduct size.
SizeUnitMeasureCodenchar3 YESUnit of measure for Size column.
StandardCostmoney NOStandard cost of the product.
Stylenchar2 YESW = Womens, M = Mens, U = Universal
Weightdecimal YESProduct weight.
WeightUnitMeasureCodenchar3 YESUnit of measure for Weight column.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
ProductPK_Product_ProductIDProductIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductAK_Product_ProductNumberProductNumberNONCLUSTEREDtruefalsefalsefalsefalsefalse
ProductAK_Product_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
ProductAK_Product_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
ufnGetProductDealerPriceSQL_SCALAR_FUNCTION
ufnGetProductListPriceSQL_SCALAR_FUNCTION
ufnGetProductStandardCostSQL_SCALAR_FUNCTION
uspGetBillOfMaterialsSQL_STORED_PROCEDURE
uspGetWhereUsedProductIDSQL_STORED_PROCEDURE
vProductAndDescriptionVIEW
ProductCategory
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Namenvarchar50 NOCategory description.
Namenvarchar50 NOUnique nonclustered index.
ProductCategoryIDint NOPrimary key for ProductCategory records.
ProductCategoryIDint NOClustered index created by a primary key constraint.
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
rowguiduniqueidentifier (newid())NOUnique nonclustered index. Used to support replication samples.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
ProductCategoryPK_ProductCategory_ProductCategoryIDProductCategoryIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductCategoryAK_ProductCategory_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
ProductCategoryAK_ProductCategory_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
ProductCostHistory
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
EndDatedatetime YESProduct cost end date.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
ProductIDint NOProduct identification number. Foreign key to Product.ProductID
ProductIDint NOClustered index created by a primary key constraint.
StandardCostmoney NOStandard cost of the product.
StartDatedatetime NOProduct cost start date.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
ProductCostHistoryPK_ProductCostHistory_ProductID_StartDateProductIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductCostHistoryPK_ProductCostHistory_ProductID_StartDateStartDateCLUSTEREDtruetruefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
ufnGetProductStandardCostSQL_SCALAR_FUNCTION
ProductDescription
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
Descriptionnvarchar400 NODescription of the product.
Descriptionnvarchar400 NOUnique nonclustered index. Used to support replication samples.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
ProductDescriptionIDint NOPrimary key for ProductDescription records.
ProductDescriptionIDint NOClustered index created by a primary key constraint.
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
ProductDescriptionPK_ProductDescription_ProductDescriptionIDProductDescriptionIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductDescriptionAK_ProductDescription_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
vProductAndDescriptionVIEW
ProductDocument
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
DocumentIDint NODocument identification number. Foreign key to Document.DocumentID.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
ProductIDint NOProduct identification number. Foreign key to Product.ProductID.
ProductIDint NOClustered index created by a primary key constraint.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
ProductDocumentPK_ProductDocument_ProductID_DocumentIDProductIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductDocumentPK_ProductDocument_ProductID_DocumentIDDocumentIDCLUSTEREDtruetruefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
ProductInventory
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
Bintinyint NOStorage container on a shelf in an inventory location.
LocationIDsmallint NOInventory location identification number. Foreign key to Location.LocationID. 
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
ProductIDint NOProduct identification number. Foreign key to Product.ProductID.
ProductIDint NOClustered index created by a primary key constraint.
Quantitysmallint ((0))NOQuantity of products in the inventory location.
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
Shelfnvarchar10 NOStorage compartment within an inventory location.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
ProductInventoryPK_ProductInventory_ProductID_LocationIDProductIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductInventoryPK_ProductInventory_ProductID_LocationIDLocationIDCLUSTEREDtruetruefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
ufnGetStockSQL_SCALAR_FUNCTION
ProductListPriceHistory
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
EndDatedatetime YESList price end date
ListPricemoney NOProduct list price.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
ProductIDint NOProduct identification number. Foreign key to Product.ProductID
ProductIDint NOClustered index created by a primary key constraint.
StartDatedatetime NOList price start date.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
ProductListPriceHistoryPK_ProductListPriceHistory_ProductID_StartDateProductIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductListPriceHistoryPK_ProductListPriceHistory_ProductID_StartDateStartDateCLUSTEREDtruetruefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
ufnGetProductDealerPriceSQL_SCALAR_FUNCTION
ufnGetProductListPriceSQL_SCALAR_FUNCTION
ProductModel
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
CatalogDescriptionxml-1 YESDetailed product catalog information in xml format.
CatalogDescriptionxml-1 YESUnique nonclustered index. Used to support replication samples.
Instructionsxml-1 YESManufacturing instructions in xml format.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Namenvarchar50 NOProduct model description.
Namenvarchar50 NOUnique nonclustered index.
ProductModelIDint NOPrimary key for ProductModel records.
ProductModelIDint NOClustered index created by a primary key constraint.
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
ProductModelPK_ProductModel_ProductModelIDProductModelIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductModelAK_ProductModel_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
ProductModelAK_ProductModel_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
ProductModelPXML_ProductModel_CatalogDescriptionCatalogDescriptionXMLfalsefalsefalsefalsefalsefalse
ProductModelPXML_ProductModel_InstructionsInstructionsXMLfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
vProductAndDescriptionVIEW
vProductModelCatalogDescriptionVIEW
vProductModelInstructionsVIEW
ProductModelIllustration
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
IllustrationIDint NOPrimary key. Foreign key to Illustration.IllustrationID.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
ProductModelIDint NOPrimary key. Foreign key to ProductModel.ProductModelID.
ProductModelIDint NOClustered index created by a primary key constraint.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
ProductModelIllustrationPK_ProductModelIllustration_ProductModelID_IllustrationIDProductModelIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductModelIllustrationPK_ProductModelIllustration_ProductModelID_IllustrationIDIllustrationIDCLUSTEREDtruetruefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
ProductModelProductDescriptionCulture
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
CultureIDnchar6 NOCulture identification number. Foreign key to Culture.CultureID.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
ProductDescriptionIDint NOPrimary key. Foreign key to ProductDescription.ProductDescriptionID.
ProductModelIDint NOPrimary key. Foreign key to ProductModel.ProductModelID.
ProductModelIDint NOClustered index created by a primary key constraint.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
ProductModelProductDescriptionCulturePK_ProductModelProductDescriptionCulture_ProductModelID_ProductDescriptionID_CultureIDProductModelIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductModelProductDescriptionCulturePK_ProductModelProductDescriptionCulture_ProductModelID_ProductDescriptionID_CultureIDProductDescriptionIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductModelProductDescriptionCulturePK_ProductModelProductDescriptionCulture_ProductModelID_ProductDescriptionID_CultureIDCultureIDCLUSTEREDtruetruefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
vProductAndDescriptionVIEW
ProductPhoto
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
LargePhotovarbinary-1 YESLarge image of the product.
LargePhotoFileNamenvarchar50 YESLarge image file name.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
ProductPhotoIDint NOPrimary key for ProductPhoto records.
ProductPhotoIDint NOClustered index created by a primary key constraint.
ThumbNailPhotovarbinary-1 YESSmall image of the product.
ThumbnailPhotoFileNamenvarchar50 YESSmall image file name.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
ProductPhotoPK_ProductPhoto_ProductPhotoIDProductPhotoIDCLUSTEREDtruetruefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
ProductProductPhoto
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Primarybit ((0))NO0 = Photo is not the principal image. 1 = Photo is the principal image.
ProductIDint NOProduct identification number. Foreign key to Product.ProductID.
ProductPhotoIDint NOProduct photo identification number. Foreign key to ProductPhoto.ProductPhotoID.
ProductPhotoIDint NONonclustered index created by a primary key constraint.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
ProductProductPhotoPK_ProductProductPhoto_ProductID_ProductPhotoIDProductIDNONCLUSTEREDtruetruefalsefalsefalsefalse
ProductProductPhotoPK_ProductProductPhoto_ProductID_ProductPhotoIDProductPhotoIDNONCLUSTEREDtruetruefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
ProductReview
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
Commentsnvarchar3850 YESReviewer's comments
EmailAddressnvarchar50 NOReviewer's e-mail address.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
ProductIDint NOProduct identification number. Foreign key to Product.ProductID.
ProductIDint NONonclustered index.
ProductReviewIDint NOPrimary key for ProductReview records.
ProductReviewIDint NOClustered index created by a primary key constraint.
Ratingint NOProduct rating given by the reviewer. Scale is 1 to 5 with 5 as the highest rating.
ReviewDatedatetime (getdate())NODate review was submitted.
ReviewerNamenvarchar50 NOName of the reviewer.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
ProductReviewPK_ProductReview_ProductReviewIDProductReviewIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductReviewIX_ProductReview_ProductID_NameProductIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
ProductReviewIX_ProductReview_ProductID_NameReviewerNameNONCLUSTEREDfalsefalsefalsefalsefalsefalse
ProductReviewIX_ProductReview_ProductID_NameCommentsNONCLUSTEREDfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
ProductSubcategory
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Namenvarchar50 NOSubcategory description.
Namenvarchar50 NOUnique nonclustered index. Used to support replication samples.
ProductCategoryIDint NOProduct category identification number. Foreign key to ProductCategory.ProductCategoryID.
ProductCategoryIDint NOUnique nonclustered index.
ProductSubcategoryIDint NOPrimary key for ProductSubcategory records.
ProductSubcategoryIDint NOClustered index created by a primary key constraint.
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
ProductSubcategoryPK_ProductSubcategory_ProductSubcategoryIDProductSubcategoryIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductSubcategoryAK_ProductSubcategory_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
ProductSubcategoryAK_ProductSubcategory_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
ScrapReason
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Namenvarchar50 NOFailure description.
Namenvarchar50 NOUnique nonclustered index.
ScrapReasonIDsmallint NOPrimary key for ScrapReason records.
ScrapReasonIDsmallint NOClustered index created by a primary key constraint.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
ScrapReasonPK_ScrapReason_ScrapReasonIDScrapReasonIDCLUSTEREDtruetruefalsefalsefalsefalse
ScrapReasonAK_ScrapReason_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
TransactionHistory
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
ActualCostmoney NOProduct cost.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
ProductIDint NOProduct identification number. Foreign key to Product.ProductID.
ProductIDint NONonclustered index.
Quantityint NOProduct quantity.
ReferenceOrderIDint NOPurchase order, sales order, or work order identification number.
ReferenceOrderIDint NONonclustered index.
ReferenceOrderLineIDint ((0))NOLine number associated with the purchase order, sales order, or work order.
TransactionDatedatetime (getdate())NODate and time of the transaction.
TransactionIDint NOPrimary key for TransactionHistory records.
TransactionIDint NOClustered index created by a primary key constraint.
TransactionTypenchar1 NOW = WorkOrder, S = SalesOrder, P = PurchaseOrder
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
TransactionHistoryPK_TransactionHistory_TransactionIDTransactionIDCLUSTEREDtruetruefalsefalsefalsefalse
TransactionHistoryIX_TransactionHistory_ProductIDProductIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
TransactionHistoryIX_TransactionHistory_ReferenceOrderID_ReferenceOrderLineIDReferenceOrderIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
TransactionHistoryIX_TransactionHistory_ReferenceOrderID_ReferenceOrderLineIDReferenceOrderLineIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
iduSalesOrderDetailSQL_TRIGGER
iPurchaseOrderDetailSQL_TRIGGER
iWorkOrderSQL_TRIGGER
uPurchaseOrderDetailSQL_TRIGGER
uWorkOrderSQL_TRIGGER
TransactionHistoryArchive
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
ActualCostmoney NOProduct cost.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
ProductIDint NOProduct identification number. Foreign key to Product.ProductID.
ProductIDint NONonclustered index.
Quantityint NOProduct quantity.
ReferenceOrderIDint NOPurchase order, sales order, or work order identification number.
ReferenceOrderIDint NONonclustered index.
ReferenceOrderLineIDint ((0))NOLine number associated with the purchase order, sales order, or work order.
TransactionDatedatetime (getdate())NODate and time of the transaction.
TransactionIDint NOPrimary key for TransactionHistoryArchive records.
TransactionIDint NOClustered index created by a primary key constraint.
TransactionTypenchar1 NOW = Work Order, S = Sales Order, P = Purchase Order
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
TransactionHistoryArchivePK_TransactionHistoryArchive_TransactionIDTransactionIDCLUSTEREDtruetruefalsefalsefalsefalse
TransactionHistoryArchiveIX_TransactionHistoryArchive_ProductIDProductIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
TransactionHistoryArchiveIX_TransactionHistoryArchive_ReferenceOrderID_ReferenceOrderLineIDReferenceOrderIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
TransactionHistoryArchiveIX_TransactionHistoryArchive_ReferenceOrderID_ReferenceOrderLineIDReferenceOrderLineIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
UnitMeasure
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Namenvarchar50 NOUnit of measure description.
Namenvarchar50 NOUnique nonclustered index.
UnitMeasureCodenchar3 NOPrimary key.
UnitMeasureCodenchar3 NOClustered index created by a primary key constraint.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
UnitMeasurePK_UnitMeasure_UnitMeasureCodeUnitMeasureCodeCLUSTEREDtruetruefalsefalsefalsefalse
UnitMeasureAK_UnitMeasure_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
WorkOrder
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
DueDatedatetime NOWork order due date.
EndDatedatetime YESWork order end date.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
OrderQtyint NOProduct quantity to build.
OrderQtyint NONonclustered index.
ProductIDint NOProduct identification number. Foreign key to Product.ProductID.
ProductIDint NONonclustered index.
ScrappedQtysmallint NOQuantity that failed inspection.
ScrapReasonIDsmallint YESReason for inspection failure.
StartDatedatetime NOWork order start date.
StockedQtyint NOQuantity built and put in inventory.
WorkOrderIDint NOPrimary key for WorkOrder records.
WorkOrderIDint NOClustered index created by a primary key constraint.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
WorkOrderPK_WorkOrder_WorkOrderIDWorkOrderIDCLUSTEREDtruetruefalsefalsefalsefalse
WorkOrderIX_WorkOrder_ScrapReasonIDScrapReasonIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
WorkOrderIX_WorkOrder_ProductIDProductIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
uWorkOrderSQL_TRIGGER
WorkOrderUSER_TABLE
WorkOrderRouting
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
ActualCostmoney YESActual manufacturing cost.
ActualEndDatedatetime YESActual end date.
ActualResourceHrsdecimal YESNumber of manufacturing hours used.
ActualStartDatedatetime YESActual start date.
LocationIDsmallint NOManufacturing location where the part is processed. Foreign key to Location.LocationID.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
OperationSequencesmallint NOPrimary key. Indicates the manufacturing process sequence.
PlannedCostmoney NOEstimated manufacturing cost.
ProductIDint NOPrimary key. Foreign key to Product.ProductID.
ProductIDint NONonclustered index.
ScheduledEndDatedatetime NOPlanned manufacturing end date.
ScheduledStartDatedatetime NOPlanned manufacturing start date.
WorkOrderIDint NOPrimary key. Foreign key to WorkOrder.WorkOrderID.
WorkOrderIDint NOClustered index created by a primary key constraint.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
WorkOrderRoutingPK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequenceWorkOrderIDCLUSTEREDtruetruefalsefalsefalsefalse
WorkOrderRoutingPK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequenceProductIDCLUSTEREDtruetruefalsefalsefalsefalse
WorkOrderRoutingPK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequenceOperationSequenceCLUSTEREDtruetruefalsefalsefalsefalse
WorkOrderRoutingIX_WorkOrderRouting_ProductIDProductIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
ProductVendor
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
AverageLeadTimeint NOThe average span of time (in days) between placing an order with the vendor and receiving the purchased product.
AverageLeadTimeint NONonclustered index.
LastReceiptCostmoney YESThe selling price when last purchased.
LastReceiptDatedatetime YESDate the product was last received by the vendor.
MaxOrderQtyint NOThe minimum quantity that should be ordered.
MinOrderQtyint NOThe maximum quantity that should be ordered.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
OnOrderQtyint YESThe quantity currently on order.
ProductIDint NOPrimary key. Foreign key to Product.ProductID.
ProductIDint NOClustered index created by a primary key constraint.
StandardPricemoney NOThe vendor's usual selling price.
UnitMeasureCodenchar3 NOThe product's unit of measure.
VendorIDint NOPrimary key. Foreign key to Vendor.VendorID.
VendorIDint NONonclustered index.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
ProductVendorPK_ProductVendor_ProductID_VendorIDProductIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductVendorPK_ProductVendor_ProductID_VendorIDVendorIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductVendorIX_ProductVendor_UnitMeasureCodeUnitMeasureCodeNONCLUSTEREDfalsefalsefalsefalsefalsefalse
ProductVendorIX_ProductVendor_VendorIDVendorIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
PurchaseOrderDetail
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
DueDatedatetime NODate the product is expected to be received.
LineTotalmoney NOPer product subtotal. Computed as OrderQty * UnitPrice.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
OrderQtysmallint NOQuantity ordered.
ProductIDint NOProduct identification number. Foreign key to Product.ProductID.
PurchaseOrderDetailIDint NOPrimary key. One line number per purchased product.
PurchaseOrderDetailIDint NONonclustered index.
PurchaseOrderIDint NOPrimary key. Foreign key to PurchaseOrderHeader.PurchaseOrderID.
PurchaseOrderIDint NOClustered index created by a primary key constraint.
ReceivedQtydecimal NOQuantity actually received from the vendor.
RejectedQtydecimal NOQuantity rejected during inspection.
StockedQtydecimal NOQuantity accepted into inventory. Computed as ReceivedQty - RejectedQty.
UnitPricemoney NOVendor's selling price of a single product.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
PurchaseOrderDetailPK_PurchaseOrderDetail_PurchaseOrderID_PurchaseOrderDetailIDPurchaseOrderIDCLUSTEREDtruetruefalsefalsefalsefalse
PurchaseOrderDetailPK_PurchaseOrderDetail_PurchaseOrderID_PurchaseOrderDetailIDPurchaseOrderDetailIDCLUSTEREDtruetruefalsefalsefalsefalse
PurchaseOrderDetailIX_PurchaseOrderDetail_ProductIDProductIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
iPurchaseOrderDetailSQL_TRIGGER
uPurchaseOrderDetailSQL_TRIGGER
PurchaseOrderDetailUSER_TABLE
PurchaseOrderHeader
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
EmployeeIDint NOEmployee who created the purchase order. Foreign key to Employee.EmployeeID.
Freightmoney ((0.00))NOShipping cost.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
OrderDatedatetime (getdate())NOPurchase order creation date.
PurchaseOrderIDint NOPrimary key.
PurchaseOrderIDint NOClustered index created by a primary key constraint.
RevisionNumbertinyint ((0))NOIncremental number to track changes to the purchase order over time.
RevisionNumbertinyint ((0))NONonclustered index.
ShipDatedatetime YESEstimated shipment date from the vendor.
ShipMethodIDint NOShipping method. Foreign key to ShipMethod.ShipMethodID.
Statustinyint ((1))NOOrder current status. 1 = Pending; 2 = Approved; 3 = Rejected; 4 = Complete
Statustinyint ((1))NONonclustered index.
SubTotalmoney ((0.00))NOPurchase order subtotal. Computed as SUM(PurchaseOrderDetail.LineTotal)for the appropriate PurchaseOrderID.
TaxAmtmoney ((0.00))NOTax amount.
TotalDuemoney NOTotal due to vendor. Computed as Subtotal + TaxAmt + Freight.
VendorIDint NOVendor with whom the purchase order is placed. Foreign key to Vendor.VendorID.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
PurchaseOrderHeaderPK_PurchaseOrderHeader_PurchaseOrderIDPurchaseOrderIDCLUSTEREDtruetruefalsefalsefalsefalse
PurchaseOrderHeaderIX_PurchaseOrderHeader_VendorIDVendorIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
PurchaseOrderHeaderIX_PurchaseOrderHeader_EmployeeIDEmployeeIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
iPurchaseOrderDetailSQL_TRIGGER
uPurchaseOrderDetailSQL_TRIGGER
uPurchaseOrderHeaderSQL_TRIGGER
PurchaseOrderHeaderUSER_TABLE
ShipMethod
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Namenvarchar50 NOShipping company name.
Namenvarchar50 NOUnique nonclustered index.
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ShipBasemoney ((0.00))NOMinimum shipping charge.
ShipBasemoney ((0.00))NOUnique nonclustered index. Used to support replication samples.
ShipMethodIDint NOPrimary key for ShipMethod records.
ShipMethodIDint NOClustered index created by a primary key constraint.
ShipRatemoney ((0.00))NOShipping charge per pound.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
ShipMethodPK_ShipMethod_ShipMethodIDShipMethodIDCLUSTEREDtruetruefalsefalsefalsefalse
ShipMethodAK_ShipMethod_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
ShipMethodAK_ShipMethod_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
Vendor
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
AccountNumbernvarchar15 NOVendor account (identification) number.
AccountNumbernvarchar15 NOUnique nonclustered index.
ActiveFlagbit ((1))NO0 = Vendor no longer used. 1 = Vendor is actively used.
CreditRatingtinyint NO1 = Superior, 2 = Excellent, 3 = Above average, 4 = Average, 5 = Below average
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Namenvarchar50 NOCompany name.
PreferredVendorStatusbit ((1))NO0 = Do not use if another vendor is available. 1 = Preferred over other vendors supplying the same product.
PurchasingWebServiceURLnvarchar1024 YESVendor URL.
VendorIDint NOPrimary key for Vendor records.
VendorIDint NOClustered index created by a primary key constraint.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
VendorPK_Vendor_VendorIDVendorIDCLUSTEREDtruetruefalsefalsefalsefalse
VendorAK_Vendor_AccountNumberAccountNumberNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
vVendorVIEW
VendorAddress
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
AddressIDint NOPrimary key. Foreign key to Address.AddressID.
AddressIDint NONonclustered index.
AddressTypeIDint NOAddress type. Foreign key to AddressType.AddressTypeID.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
VendorIDint NOPrimary key. Foreign key to Vendor.VendorID.
VendorIDint NOClustered index created by a primary key constraint.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
VendorAddressPK_VendorAddress_VendorID_AddressIDVendorIDCLUSTEREDtruetruefalsefalsefalsefalse
VendorAddressPK_VendorAddress_VendorID_AddressIDAddressIDCLUSTEREDtruetruefalsefalsefalsefalse
VendorAddressIX_VendorAddress_AddressIDAddressIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
vVendorVIEW
VendorContact
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
ContactIDint NOContact (Vendor employee) identification number. Foreign key to Contact.ContactID.
ContactIDint NONonclustered index.
ContactTypeIDint NOContact type such as sales manager, or sales agent.
ContactTypeIDint NONonclustered index.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
VendorIDint NOPrimary key.
VendorIDint NOClustered index created by a primary key constraint.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
VendorContactPK_VendorContact_VendorID_ContactIDVendorIDCLUSTEREDtruetruefalsefalsefalsefalse
VendorContactPK_VendorContact_VendorID_ContactIDContactIDCLUSTEREDtruetruefalsefalsefalsefalse
VendorContactIX_VendorContact_ContactIDContactIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
VendorContactIX_VendorContact_ContactTypeIDContactTypeIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
ufnGetContactInformationSQL_TABLE_VALUED_FUNCTION
vVendorVIEW
ContactCreditCard
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
ContactIDint NOCustomer identification number. Foreign key to Contact.ContactID.
ContactIDint NOClustered index created by a primary key constraint.
CreditCardIDint NOCredit card identification number. Foreign key to CreditCard.CreditCardID.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
ContactCreditCardPK_ContactCreditCard_ContactID_CreditCardIDContactIDCLUSTEREDtruetruefalsefalsefalsefalse
ContactCreditCardPK_ContactCreditCard_ContactID_CreditCardIDCreditCardIDCLUSTEREDtruetruefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
CountryRegionCurrency
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
CountryRegionCodenvarchar3 NOISO code for countries and regions. Foreign key to CountryRegion.CountryRegionCode.
CountryRegionCodenvarchar3 NOClustered index created by a primary key constraint.
CurrencyCodenchar3 NOISO standard currency code. Foreign key to Currency.CurrencyCode.
CurrencyCodenchar3 NONonclustered index.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
CountryRegionCurrencyPK_CountryRegionCurrency_CountryRegionCode_CurrencyCodeCountryRegionCodeCLUSTEREDtruetruefalsefalsefalsefalse
CountryRegionCurrencyPK_CountryRegionCurrency_CountryRegionCode_CurrencyCodeCurrencyCodeCLUSTEREDtruetruefalsefalsefalsefalse
CountryRegionCurrencyIX_CountryRegionCurrency_CurrencyCodeCurrencyCodeNONCLUSTEREDfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
CreditCard
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
CardNumbernvarchar25 NOCredit card number.
CardTypenvarchar50 NOCredit card name.
CardTypenvarchar50 NOUnique nonclustered index.
CreditCardIDint NOPrimary key for CreditCard records.
CreditCardIDint NOClustered index created by a primary key constraint.
ExpMonthtinyint NOCredit card expiration month.
ExpYearsmallint NOCredit card expiration year.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
CreditCardPK_CreditCard_CreditCardIDCreditCardIDCLUSTEREDtruetruefalsefalsefalsefalse
CreditCardAK_CreditCard_CardNumberCardNumberNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
Currency
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
CurrencyCodenchar3 NOThe ISO code for the Currency.
CurrencyCodenchar3 NOClustered index created by a primary key constraint.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Namenvarchar50 NOCurrency name.
Namenvarchar50 NOUnique nonclustered index.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
CurrencyPK_Currency_CurrencyCodeCurrencyCodeCLUSTEREDtruetruefalsefalsefalsefalse
CurrencyAK_Currency_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
CurrencyRate
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
AverageRatemoney NOAverage exchange rate for the day.
CurrencyRateDatedatetime NODate and time the exchange rate was obtained.
CurrencyRateDatedatetime NOUnique nonclustered index.
CurrencyRateIDint NOPrimary key for CurrencyRate records.
CurrencyRateIDint NOClustered index created by a primary key constraint.
EndOfDayRatemoney NOFinal exchange rate for the day.
FromCurrencyCodenchar3 NOExchange rate was converted from this currency code.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
ToCurrencyCodenchar3 NOExchange rate was converted to this currency code.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
CurrencyRatePK_CurrencyRate_CurrencyRateIDCurrencyRateIDCLUSTEREDtruetruefalsefalsefalsefalse
CurrencyRateAK_CurrencyRate_CurrencyRateDate_FromCurrencyCode_ToCurrencyCodeCurrencyRateDateNONCLUSTEREDtruefalsefalsefalsefalsefalse
CurrencyRateAK_CurrencyRate_CurrencyRateDate_FromCurrencyCode_ToCurrencyCodeFromCurrencyCodeNONCLUSTEREDtruefalsefalsefalsefalsefalse
CurrencyRateAK_CurrencyRate_CurrencyRateDate_FromCurrencyCode_ToCurrencyCodeToCurrencyCodeNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
Customer
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
AccountNumbervarchar10 NOUnique number identifying the customer assigned by the accounting system.
AccountNumbervarchar10 NOUnique nonclustered index.
CustomerIDint NOPrimary key for Customer records.
CustomerIDint NOClustered index created by a primary key constraint.
CustomerTypenchar1 NOCustomer type: I = Individual, S = Store
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
rowguiduniqueidentifier (newid())NONonclustered index.
TerritoryIDint YESID of the territory in which the customer is located. Foreign key to SalesTerritory.SalesTerritoryID.
TerritoryIDint YESUnique nonclustered index. Used to support replication samples.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
CustomerPK_Customer_CustomerIDCustomerIDCLUSTEREDtruetruefalsefalsefalsefalse
CustomerAK_Customer_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
CustomerAK_Customer_AccountNumberAccountNumberNONCLUSTEREDtruefalsefalsefalsefalsefalse
CustomerIX_Customer_TerritoryIDTerritoryIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
ufnLeadingZerosSQL_SCALAR_FUNCTION
CustomerUSER_TABLE
vIndividualCustomerVIEW
vStoreWithDemographicsVIEW
CustomerAddress
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
AddressIDint NOPrimary key. Foreign key to Address.AddressID.
AddressIDint NOUnique nonclustered index. Used to support replication samples.
AddressTypeIDint NOAddress type. Foreign key to AddressType.AddressTypeID.
CustomerIDint NOPrimary key. Foreign key to Customer.CustomerID.
CustomerIDint NOClustered index created by a primary key constraint.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
CustomerAddressPK_CustomerAddress_CustomerID_AddressIDCustomerIDCLUSTEREDtruetruefalsefalsefalsefalse
CustomerAddressPK_CustomerAddress_CustomerID_AddressIDAddressIDCLUSTEREDtruetruefalsefalsefalsefalse
CustomerAddressAK_CustomerAddress_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
vIndividualCustomerVIEW
vStoreWithDemographicsVIEW
Individual
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
ContactIDint NOIdentifies the customer in the Contact table. Foreign key to Contact.ContactID.
CustomerIDint NOUnique customer identification number. Foreign key to Customer.CustomerID.
CustomerIDint NOClustered index created by a primary key constraint.
Demographicsxml-1 YESPersonal information such as hobbies, and income collected from online shoppers. Used for sales analysis.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
IndividualPK_Individual_CustomerIDCustomerIDCLUSTEREDtruetruefalsefalsefalsefalse
IndividualPXML_Individual_DemographicsDemographicsXMLfalsefalsefalsefalsefalsefalse
IndividualXMLPATH_Individual_DemographicsDemographicsXMLfalsefalsefalsefalsefalsefalse
IndividualXMLPROPERTY_Individual_DemographicsDemographicsXMLfalsefalsefalsefalsefalsefalse
IndividualXMLVALUE_Individual_DemographicsDemographicsXMLfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
ufnGetContactInformationSQL_TABLE_VALUED_FUNCTION
iduSalesOrderDetailSQL_TRIGGER
iStoreSQL_TRIGGER
iuIndividualSQL_TRIGGER
vIndividualCustomerVIEW
vIndividualDemographicsVIEW
SalesOrderDetail
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
CarrierTrackingNumbernvarchar25 YESShipment tracking number supplied by the shipper.
CarrierTrackingNumbernvarchar25 YESNonclustered index.
LineTotalnumeric NOPer product subtotal. Computed as UnitPrice * (1 - UnitPriceDiscount) * OrderQty.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
OrderQtysmallint NOQuantity ordered per product.
ProductIDint NOProduct sold to customer. Foreign key to Product.ProductID.
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
SalesOrderDetailIDint NOPrimary key. One incremental unique number per product sold.
SalesOrderDetailIDint NOUnique nonclustered index. Used to support replication samples.
SalesOrderIDint NOPrimary key. Foreign key to SalesOrderHeader.SalesOrderID.
SalesOrderIDint NOClustered index created by a primary key constraint.
SpecialOfferIDint NOPromotional code. Foreign key to SpecialOffer.SpecialOfferID.
UnitPricemoney NOSelling price of a single product.
UnitPriceDiscountmoney ((0.0))NODiscount amount.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
SalesOrderDetailPK_SalesOrderDetail_SalesOrderID_SalesOrderDetailIDSalesOrderIDCLUSTEREDtruetruefalsefalsefalsefalse
SalesOrderDetailPK_SalesOrderDetail_SalesOrderID_SalesOrderDetailIDSalesOrderDetailIDCLUSTEREDtruetruefalsefalsefalsefalse
SalesOrderDetailAK_SalesOrderDetail_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
SalesOrderDetailIX_SalesOrderDetail_ProductIDProductIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
iduSalesOrderDetailSQL_TRIGGER
SalesOrderDetailUSER_TABLE
SalesOrderHeader
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
AccountNumbernvarchar15 YESFinancial accounting number reference.
BillToAddressIDint NOCustomer billing address. Foreign key to Address.AddressID.
Commentnvarchar128 YESSales representative comments.
ContactIDint NOCustomer contact identification number. Foreign key to Contact.ContactID.
CreditCardApprovalCodevarchar15 YESApproval code provided by the credit card company.
CreditCardIDint YESCredit card identification number. Foreign key to CreditCard.CreditCardID.
CurrencyRateIDint YESCurrency exchange rate used. Foreign key to CurrencyRate.CurrencyRateID.
CustomerIDint NOCustomer identification number. Foreign key to Customer.CustomerID.
DueDatedatetime NODate the order is due to the customer.
Freightmoney ((0.00))NOShipping cost.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
OnlineOrderFlagbit ((1))NO0 = Order placed by sales person. 1 = Order placed online by customer.
OrderDatedatetime (getdate())NODates the sales order was created.
OrderDatedatetime (getdate())NOUnique nonclustered index.
PurchaseOrderNumbernvarchar25 YESCustomer purchase order number reference. 
RevisionNumbertinyint ((0))NOIncremental number to track changes to the sales order over time.
RevisionNumbertinyint ((0))NOUnique nonclustered index. Used to support replication samples.
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
SalesOrderIDint NOPrimary key.
SalesOrderIDint NOClustered index created by a primary key constraint.
SalesOrderNumbernvarchar25 NOUnique sales order identification number.
SalesPersonIDint YESSales person who created the sales order. Foreign key to SalesPerson.SalePersonID.
ShipDatedatetime YESDate the order was shipped to the customer.
ShipDatedatetime YESNonclustered index.
ShipMethodIDint NOShipping method. Foreign key to ShipMethod.ShipMethodID.
ShipToAddressIDint NOCustomer shipping address. Foreign key to Address.AddressID.
Statustinyint ((1))NOOrder current status. 1 = In process; 2 = Approved; 3 = Backordered; 4 = Rejected; 5 = Shipped; 6 = Cancelled
Statustinyint ((1))NONonclustered index.
SubTotalmoney ((0.00))NOSales subtotal. Computed as SUM(SalesOrderDetail.LineTotal)for the appropriate SalesOrderID.
TaxAmtmoney ((0.00))NOTax amount.
TerritoryIDint YESTerritory in which the sale was made. Foreign key to SalesTerritory.SalesTerritoryID.
TotalDuemoney NOTotal due from customer. Computed as Subtotal + TaxAmt + Freight.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
SalesOrderHeaderPK_SalesOrderHeader_SalesOrderIDSalesOrderIDCLUSTEREDtruetruefalsefalsefalsefalse
SalesOrderHeaderAK_SalesOrderHeader_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
SalesOrderHeaderAK_SalesOrderHeader_SalesOrderNumberSalesOrderNumberNONCLUSTEREDtruefalsefalsefalsefalsefalse
SalesOrderHeaderIX_SalesOrderHeader_CustomerIDCustomerIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
SalesOrderHeaderIX_SalesOrderHeader_SalesPersonIDSalesPersonIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
iduSalesOrderDetailSQL_TRIGGER
uSalesOrderHeaderSQL_TRIGGER
SalesOrderHeaderUSER_TABLE
vSalesPersonSalesByFiscalYearsVIEW
SalesOrderHeaderSalesReason
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
SalesOrderIDint NOPrimary key. Foreign key to SalesOrderHeader.SalesOrderID.
SalesOrderIDint NOClustered index created by a primary key constraint.
SalesReasonIDint NOPrimary key. Foreign key to SalesReason.SalesReasonID.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
SalesOrderHeaderSalesReasonPK_SalesOrderHeaderSalesReason_SalesOrderID_SalesReasonIDSalesOrderIDCLUSTEREDtruetruefalsefalsefalsefalse
SalesOrderHeaderSalesReasonPK_SalesOrderHeaderSalesReason_SalesOrderID_SalesReasonIDSalesReasonIDCLUSTEREDtruetruefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
SalesPerson
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
Bonusmoney ((0.00))NOBonus due if quota is met.
CommissionPctsmallmoney ((0.00))NOCommision percent received per sale.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
SalesLastYearmoney ((0.00))NOSales total of previous year.
SalesPersonIDint NOPrimary key for SalesPerson records.
SalesPersonIDint NOClustered index created by a primary key constraint.
SalesQuotamoney YESProjected yearly sales.
SalesYTDmoney ((0.00))NOSales total year to date.
TerritoryIDint YESTerritory currently assigned to. Foreign key to SalesTerritory.SalesTerritoryID.
TerritoryIDint YESUnique nonclustered index. Used to support replication samples.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
SalesPersonPK_SalesPerson_SalesPersonIDSalesPersonIDCLUSTEREDtruetruefalsefalsefalsefalse
SalesPersonAK_SalesPerson_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
uSalesOrderHeaderSQL_TRIGGER
vSalesPersonVIEW
vSalesPersonSalesByFiscalYearsVIEW
SalesPersonQuotaHistory
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
QuotaDatedatetime NOSales quota date.
QuotaDatedatetime NOUnique nonclustered index. Used to support replication samples.
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
SalesPersonIDint NOSales person identification number. Foreign key to SalesPerson.SalesPersonID.
SalesPersonIDint NOClustered index created by a primary key constraint.
SalesQuotamoney NOSales quota amount.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
SalesPersonQuotaHistoryPK_SalesPersonQuotaHistory_SalesPersonID_QuotaDateSalesPersonIDCLUSTEREDtruetruefalsefalsefalsefalse
SalesPersonQuotaHistoryPK_SalesPersonQuotaHistory_SalesPersonID_QuotaDateQuotaDateCLUSTEREDtruetruefalsefalsefalsefalse
SalesPersonQuotaHistoryAK_SalesPersonQuotaHistory_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
SalesReason
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Namenvarchar50 NOSales reason description.
ReasonTypenvarchar50 NOCategory the sales reason belongs to.
SalesReasonIDint NOPrimary key for SalesReason records.
SalesReasonIDint NOClustered index created by a primary key constraint.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
SalesReasonPK_SalesReason_SalesReasonIDSalesReasonIDCLUSTEREDtruetruefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
SalesTaxRate
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Namenvarchar50 NOTax rate description.
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
SalesTaxRateIDint NOPrimary key for SalesTaxRate records.
SalesTaxRateIDint NOClustered index created by a primary key constraint.
StateProvinceIDint NOState, province, or country/region the sales tax applies to.
StateProvinceIDint NOUnique nonclustered index.
TaxRatesmallmoney ((0.00))NOTax rate amount.
TaxTypetinyint NO1 = Tax applied to retail transactions, 2 = Tax applied to wholesale transactions, 3 = Tax applied to all sales (retail and wholesale) transactions.
TaxTypetinyint NOUnique nonclustered index. Used to support replication samples.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
SalesTaxRatePK_SalesTaxRate_SalesTaxRateIDSalesTaxRateIDCLUSTEREDtruetruefalsefalsefalsefalse
SalesTaxRateAK_SalesTaxRate_StateProvinceID_TaxTypeStateProvinceIDNONCLUSTEREDtruefalsefalsefalsefalsefalse
SalesTaxRateAK_SalesTaxRate_StateProvinceID_TaxTypeTaxTypeNONCLUSTEREDtruefalsefalsefalsefalsefalse
SalesTaxRateAK_SalesTaxRate_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
SalesTerritory
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
CostLastYearmoney ((0.00))NOBusiness costs in the territory the previous year.
CostYTDmoney ((0.00))NOBusiness costs in the territory year to date.
CountryRegionCodenvarchar3 NOISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode. 
CountryRegionCodenvarchar3 NOUnique nonclustered index. Used to support replication samples.
Groupnvarchar50 NOGeographic area to which the sales territory belong.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Namenvarchar50 NOSales territory description
Namenvarchar50 NOUnique nonclustered index.
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
SalesLastYearmoney ((0.00))NOSales in the territory the previous year.
SalesYTDmoney ((0.00))NOSales in the territory year to date.
TerritoryIDint NOPrimary key for SalesTerritory records.
TerritoryIDint NOClustered index created by a primary key constraint.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
SalesTerritoryPK_SalesTerritory_TerritoryIDTerritoryIDCLUSTEREDtruetruefalsefalsefalsefalse
SalesTerritoryAK_SalesTerritory_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
SalesTerritoryAK_SalesTerritory_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
uSalesOrderHeaderSQL_TRIGGER
vSalesPersonVIEW
vSalesPersonSalesByFiscalYearsVIEW
SalesTerritoryHistory
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
EndDatedatetime YESDate the sales representative left work in the territory.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
SalesPersonIDint NOPrimary key for SalesTerritoryHistory records.
SalesPersonIDint NOClustered index created by a primary key constraint.
StartDatedatetime NODate the sales representive started work in the territory.
TerritoryIDint NOTerritory identification number. Foreign key to SalesTerritory.SalesTerritoryID.
TerritoryIDint NOUnique nonclustered index. Used to support replication samples.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
SalesTerritoryHistoryPK_SalesTerritoryHistory_SalesPersonID_StartDate_TerritoryIDSalesPersonIDCLUSTEREDtruetruefalsefalsefalsefalse
SalesTerritoryHistoryPK_SalesTerritoryHistory_SalesPersonID_StartDate_TerritoryIDTerritoryIDCLUSTEREDtruetruefalsefalsefalsefalse
SalesTerritoryHistoryPK_SalesTerritoryHistory_SalesPersonID_StartDate_TerritoryIDStartDateCLUSTEREDtruetruefalsefalsefalsefalse
SalesTerritoryHistoryAK_SalesTerritoryHistory_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
ShoppingCartItem
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
DateCreateddatetime (getdate())NODate the time the record was created.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
ProductIDint NOProduct ordered. Foreign key to Product.ProductID.
Quantityint ((1))NOProduct quantity ordered.
ShoppingCartIDnvarchar50 NOShopping cart identification number.
ShoppingCartIDnvarchar50 NONonclustered index.
ShoppingCartItemIDint NOPrimary key for ShoppingCartItem records.
ShoppingCartItemIDint NOClustered index created by a primary key constraint.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
ShoppingCartItemPK_ShoppingCartItem_ShoppingCartItemIDShoppingCartItemIDCLUSTEREDtruetruefalsefalsefalsefalse
ShoppingCartItemIX_ShoppingCartItem_ShoppingCartID_ProductIDShoppingCartIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
ShoppingCartItemIX_ShoppingCartItem_ShoppingCartID_ProductIDProductIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
SpecialOffer
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
Categorynvarchar50 NOGroup the discount applies to such as Reseller or Customer.
Descriptionnvarchar255 NODiscount description.
Descriptionnvarchar255 NOUnique nonclustered index. Used to support replication samples.
DiscountPctsmallmoney ((0.00))NODiscount precentage.
EndDatedatetime NODiscount end date.
MaxQtyint YESMaximum discount percent allowed.
MinQtyint ((0))NOMinimum discount percent allowed.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
SpecialOfferIDint NOPrimary key for SpecialOffer records.
SpecialOfferIDint NOClustered index created by a primary key constraint.
StartDatedatetime NODiscount start date.
Typenvarchar50 NODiscount type category.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
SpecialOfferPK_SpecialOffer_SpecialOfferIDSpecialOfferIDCLUSTEREDtruetruefalsefalsefalsefalse
SpecialOfferAK_SpecialOffer_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
SpecialOfferProduct
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
ProductIDint NOProduct identification number. Foreign key to Product.ProductID.
ProductIDint NOUnique nonclustered index. Used to support replication samples.
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
rowguiduniqueidentifier (newid())NONonclustered index.
SpecialOfferIDint NOPrimary key for SpecialOfferProduct records.
SpecialOfferIDint NOClustered index created by a primary key constraint.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
SpecialOfferProductPK_SpecialOfferProduct_SpecialOfferID_ProductIDSpecialOfferIDCLUSTEREDtruetruefalsefalsefalsefalse
SpecialOfferProductPK_SpecialOfferProduct_SpecialOfferID_ProductIDProductIDCLUSTEREDtruetruefalsefalsefalsefalse
SpecialOfferProductAK_SpecialOfferProduct_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
SpecialOfferProductIX_SpecialOfferProduct_ProductIDProductIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
Store
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
CustomerIDint NOPrimary key. Foreign key to Customer.CustomerID.
CustomerIDint NOClustered index created by a primary key constraint.
Demographicsxml-1 YESDemographic informationg about the store such as the number of employees, annual sales and store type.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
Namenvarchar50 NOName of the store.
Namenvarchar50 NOUnique nonclustered index. Used to support replication samples.
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
SalesPersonIDint YESID of the sales person assigned to the customer. Foreign key to SalesPerson.SalesPersonID.
SalesPersonIDint YESNonclustered index.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
StorePK_Store_CustomerIDCustomerIDCLUSTEREDtruetruefalsefalsefalsefalse
StoreAK_Store_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
StoreIX_Store_SalesPersonIDSalesPersonIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
StorePXML_Store_DemographicsDemographicsXMLfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
iuIndividualSQL_TRIGGER
vStoreWithDemographicsVIEW
StoreContact
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
ContactIDint NOContact (store employee) identification number. Foreign key to Contact.ContactID.
ContactIDint NOUnique nonclustered index. Used to support replication samples.
ContactTypeIDint NOContact type such as owner or purchasing agent. Foreign key to ContactType.ContactTypeID.
ContactTypeIDint NONonclustered index.
CustomerIDint NOStore identification number. Foreign key to Customer.CustomerID.
CustomerIDint NOClustered index created by a primary key constraint.
ModifiedDatedatetime (getdate())NODate and time the record was last updated.
rowguiduniqueidentifier (newid())NOROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
rowguiduniqueidentifier (newid())NONonclustered index.
Table Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
StoreContactPK_StoreContact_CustomerID_ContactIDCustomerIDCLUSTEREDtruetruefalsefalsefalsefalse
StoreContactPK_StoreContact_CustomerID_ContactIDContactIDCLUSTEREDtruetruefalsefalsefalsefalse
StoreContactAK_StoreContact_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
StoreContactIX_StoreContact_ContactIDContactIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
StoreContactIX_StoreContact_ContactTypeIDContactTypeIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
Dependent Objects
Dependent ObjDependent Obj Type
ufnGetContactInformationSQL_TABLE_VALUED_FUNCTION
vStoreWithDemographicsVIEW
Views
View NameView Schema
vEmployeeHumanResources
vEmployeeDepartmentHumanResources
vEmployeeDepartmentHistoryHumanResources
vJobCandidateHumanResources
vJobCandidateEducationHumanResources
vJobCandidateEmploymentHumanResources
vAdditionalContactInfoPerson
vStateProvinceCountryRegionPerson
vProductAndDescriptionProduction
vProductModelCatalogDescriptionProduction
vProductModelInstructionsProduction
vVendorPurchasing
vIndividualCustomerSales
vIndividualDemographicsSales
vSalesPersonSales
vSalesPersonSalesByFiscalYearsSales
vStoreWithDemographicsSales
vEmployee
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
AdditionalContactInfoxml-1 YES
AddressLine1nvarchar60 NO
AddressLine2nvarchar60 YES
Citynvarchar30 NO
CountryRegionNamenvarchar50 NO
EmailAddressnvarchar50 YES
EmailPromotionint NO
EmployeeIDint NO
FirstNamenvarchar50 NO
JobTitlenvarchar50 NO
LastNamenvarchar50 NO
MiddleNamenvarchar50 YES
Phonenvarchar25 YES
PostalCodenvarchar15 NO
StateProvinceNamenvarchar50 NO
Suffixnvarchar10 YES
Titlenvarchar8 YES
View Definition
View Definition

CREATE VIEW [HumanResources].[vEmployee] 
AS 
SELECT 
    e.[EmployeeID]
    ,c.[Title]
    ,c.[FirstName]
    ,c.[MiddleName]
    ,c.[LastName]
    ,c.[Suffix]
    ,e.[Title] AS [JobTitle] 
    ,c.[Phone]
    ,c.[EmailAddress]
    ,c.[EmailPromotion]
    ,a.[AddressLine1]
    ,a.[AddressLine2]
    ,a.[City]
    ,sp.[Name] AS [StateProvinceName] 
    ,a.[PostalCode]
    ,cr.[Name] AS [CountryRegionName] 
    ,c.[AdditionalContactInfo]
FROM [HumanResources].[Employee] e
    INNER JOIN [Person].[Contact] c 
    ON c.[ContactID] = e.[ContactID]
    INNER JOIN [HumanResources].[EmployeeAddress] ea 
    ON e.[EmployeeID] = ea.[EmployeeID] 
    INNER JOIN [Person].[Address] a 
    ON ea.[AddressID] = a.[AddressID]
    INNER JOIN [Person].[StateProvince] sp 
    ON sp.[StateProvinceID] = a.[StateProvinceID]
    INNER JOIN [Person].[CountryRegion] cr 
    ON cr.[CountryRegionCode] = sp.[CountryRegionCode];
Tables Used in View
Table CatalogTable SchemaTable Name
AdventureWorksHumanResourcesEmployee
AdventureWorksHumanResourcesEmployeeAddress
AdventureWorksPersonAddress
AdventureWorksPersonContact
AdventureWorksPersonCountryRegion
AdventureWorksPersonStateProvince
Dependent Objects
Dependent ObjDependent Obj Type
AddressUSER_TABLE
ContactUSER_TABLE
CountryRegionUSER_TABLE
EmployeeUSER_TABLE
EmployeeAddressUSER_TABLE
StateProvinceUSER_TABLE
vEmployeeDepartment
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
Departmentnvarchar50 NO
EmployeeIDint NO
FirstNamenvarchar50 NO
GroupNamenvarchar50 NO
JobTitlenvarchar50 NO
LastNamenvarchar50 NO
MiddleNamenvarchar50 YES
StartDatedatetime NO
Suffixnvarchar10 YES
Titlenvarchar8 YES
View Definition
View Definition

CREATE VIEW [HumanResources].[vEmployeeDepartment] 
AS 
SELECT 
    e.[EmployeeID] 
    ,c.[Title] 
    ,c.[FirstName] 
    ,c.[MiddleName] 
    ,c.[LastName] 
    ,c.[Suffix] 
    ,e.[Title] AS [JobTitle] 
    ,d.[Name] AS [Department] 
    ,d.[GroupName] 
    ,edh.[StartDate] 
FROM [HumanResources].[Employee] e
    INNER JOIN [Person].[Contact] c 
    ON c.[ContactID] = e.[ContactID]
    INNER JOIN [HumanResources].[EmployeeDepartmentHistory] edh 
    ON e.[EmployeeID] = edh.[EmployeeID] 
    INNER JOIN [HumanResources].[Department] d 
    ON edh.[DepartmentID] = d.[DepartmentID] 
WHERE GETDATE() BETWEEN edh.[StartDate] AND ISNULL(edh.[EndDate], GETDATE());
Tables Used in View
Table CatalogTable SchemaTable Name
AdventureWorksHumanResourcesDepartment
AdventureWorksHumanResourcesEmployee
AdventureWorksHumanResourcesEmployeeDepartmentHistory
AdventureWorksPersonContact
Dependent Objects
Dependent ObjDependent Obj Type
ContactUSER_TABLE
DepartmentUSER_TABLE
EmployeeUSER_TABLE
EmployeeDepartmentHistoryUSER_TABLE
vEmployeeDepartmentHistory
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
Departmentnvarchar50 NO
EmployeeIDint NO
EndDatedatetime YES
FirstNamenvarchar50 NO
GroupNamenvarchar50 NO
LastNamenvarchar50 NO
MiddleNamenvarchar50 YES
Shiftnvarchar50 NO
StartDatedatetime NO
Suffixnvarchar10 YES
Titlenvarchar8 YES
View Definition
View Definition

CREATE VIEW [HumanResources].[vEmployeeDepartmentHistory] 
AS 
SELECT 
    e.[EmployeeID] 
    ,c.[Title] 
    ,c.[FirstName] 
    ,c.[MiddleName] 
    ,c.[LastName] 
    ,c.[Suffix] 
    ,s.[Name] AS [Shift]
    ,d.[Name] AS [Department] 
    ,d.[GroupName] 
    ,edh.[StartDate] 
    ,edh.[EndDate]
FROM [HumanResources].[Employee] e
    INNER JOIN [Person].[Contact] c 
    ON c.[ContactID] = e.[ContactID]
    INNER JOIN [HumanResources].[EmployeeDepartmentHistory] edh 
    ON e.[EmployeeID] = edh.[EmployeeID] 
    INNER JOIN [HumanResources].[Department] d 
    ON edh.[DepartmentID] = d.[DepartmentID] 
    INNER JOIN [HumanResources].[Shift] s
    ON s.[ShiftID] = edh.[ShiftID];
Tables Used in View
Table CatalogTable SchemaTable Name
AdventureWorksHumanResourcesDepartment
AdventureWorksHumanResourcesEmployee
AdventureWorksHumanResourcesEmployeeDepartmentHistory
AdventureWorksHumanResourcesShift
AdventureWorksPersonContact
Dependent Objects
Dependent ObjDependent Obj Type
ContactUSER_TABLE
DepartmentUSER_TABLE
EmployeeUSER_TABLE
EmployeeDepartmentHistoryUSER_TABLE
ShiftUSER_TABLE
vJobCandidate
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
Addr.Loc.Citynvarchar100 YES
Addr.Loc.CountryRegionnvarchar100 YES
Addr.Loc.Statenvarchar100 YES
Addr.PostalCodenvarchar20 YES
Addr.Typenvarchar30 YES
EMailnvarchar-1 YES
EmployeeIDint YES
JobCandidateIDint NO
ModifiedDatedatetime NO
Name.Firstnvarchar30 YES
Name.Lastnvarchar30 YES
Name.Middlenvarchar30 YES
Name.Prefixnvarchar30 YES
Name.Suffixnvarchar30 YES
Skillsnvarchar-1 YES
WebSitenvarchar-1 YES
View Definition
View Definition

CREATE VIEW [HumanResources].[vJobCandidate] 
AS 
SELECT 
    jc.[JobCandidateID] 
    ,jc.[EmployeeID] 
    ,[Resume].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (/Resume/Name/Name.Prefix)[1]', 'nvarchar(30)') AS [Name.Prefix] 
    ,[Resume].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume";
        (/Resume/Name/Name.First)[1]', 'nvarchar(30)') AS [Name.First] 
    ,[Resume].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (/Resume/Name/Name.Middle)[1]', 'nvarchar(30)') AS [Name.Middle] 
    ,[Resume].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (/Resume/Name/Name.Last)[1]', 'nvarchar(30)') AS [Name.Last] 
    ,[Resume].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (/Resume/Name/Name.Suffix)[1]', 'nvarchar(30)') AS [Name.Suffix] 
    ,[Resume].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (/Resume/Skills)[1]', 'nvarchar(max)') AS [Skills] 
    ,[Resume].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Address/Addr.Type)[1]', 'nvarchar(30)') AS [Addr.Type]
    ,[Resume].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Address/Addr.Location/Location/Loc.CountryRegion)[1]', 'nvarchar(100)') AS [Addr.Loc.CountryRegion]
    ,[Resume].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Address/Addr.Location/Location/Loc.State)[1]', 'nvarchar(100)') AS [Addr.Loc.State]
    ,[Resume].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Address/Addr.Location/Location/Loc.City)[1]', 'nvarchar(100)') AS [Addr.Loc.City]
    ,[Resume].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Address/Addr.PostalCode)[1]', 'nvarchar(20)') AS [Addr.PostalCode]
    ,[Resume].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (/Resume/EMail)[1]', 'nvarchar(max)') AS [EMail] 
    ,[Resume].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (/Resume/WebSite)[1]', 'nvarchar(max)') AS [WebSite] 
    ,jc.[ModifiedDate] 
FROM [HumanResources].[JobCandidate] jc 
CROSS APPLY jc.[Resume].nodes(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
    /Resume') AS Resume(ref);
Tables Used in View
Table CatalogTable SchemaTable Name
AdventureWorksHumanResourcesJobCandidate
Dependent Objects
Dependent ObjDependent Obj Type
JobCandidateUSER_TABLE
vJobCandidateEducation
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
Edu.Degreenvarchar50 YES
Edu.EndDatedatetime YES
Edu.GPAnvarchar5 YES
Edu.GPAScalenvarchar5 YES
Edu.Levelnvarchar-1 YES
Edu.Loc.Citynvarchar100 YES
Edu.Loc.CountryRegionnvarchar100 YES
Edu.Loc.Statenvarchar100 YES
Edu.Majornvarchar50 YES
Edu.Minornvarchar50 YES
Edu.Schoolnvarchar100 YES
Edu.StartDatedatetime YES
JobCandidateIDint NO
View Definition
View Definition

CREATE VIEW [HumanResources].[vJobCandidateEducation] 
AS 
SELECT 
    jc.[JobCandidateID] 
    ,[Education].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Edu.Level)[1]', 'nvarchar(max)') AS [Edu.Level]
    ,CONVERT(datetime, REPLACE([Education].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Edu.StartDate)[1]', 'nvarchar(20)') ,'Z', ''), 101) AS [Edu.StartDate] 
    ,CONVERT(datetime, REPLACE([Education].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Edu.EndDate)[1]', 'nvarchar(20)') ,'Z', ''), 101) AS [Edu.EndDate] 
    ,[Education].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Edu.Degree)[1]', 'nvarchar(50)') AS [Edu.Degree]
    ,[Education].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Edu.Major)[1]', 'nvarchar(50)') AS [Edu.Major]
    ,[Education].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Edu.Minor)[1]', 'nvarchar(50)') AS [Edu.Minor]
    ,[Education].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Edu.GPA)[1]', 'nvarchar(5)') AS [Edu.GPA]
    ,[Education].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Edu.GPAScale)[1]', 'nvarchar(5)') AS [Edu.GPAScale]
    ,[Education].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Edu.School)[1]', 'nvarchar(100)') AS [Edu.School]
    ,[Education].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Edu.Location/Location/Loc.CountryRegion)[1]', 'nvarchar(100)') AS [Edu.Loc.CountryRegion]
    ,[Education].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Edu.Location/Location/Loc.State)[1]', 'nvarchar(100)') AS [Edu.Loc.State]
    ,[Education].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Edu.Location/Location/Loc.City)[1]', 'nvarchar(100)') AS [Edu.Loc.City]
FROM [HumanResources].[JobCandidate] jc 
CROSS APPLY jc.[Resume].nodes(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
    /Resume/Education') AS [Education](ref);
Tables Used in View
Table CatalogTable SchemaTable Name
AdventureWorksHumanResourcesJobCandidate
Dependent Objects
Dependent ObjDependent Obj Type
JobCandidateUSER_TABLE
vJobCandidateEmployment
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
Emp.EndDatedatetime YES
Emp.FunctionCategorynvarchar-1 YES
Emp.IndustryCategorynvarchar-1 YES
Emp.JobTitlenvarchar100 YES
Emp.Loc.Citynvarchar-1 YES
Emp.Loc.CountryRegionnvarchar-1 YES
Emp.Loc.Statenvarchar-1 YES
Emp.OrgNamenvarchar100 YES
Emp.Responsibilitynvarchar-1 YES
Emp.StartDatedatetime YES
JobCandidateIDint NO
View Definition
View Definition

CREATE VIEW [HumanResources].[vJobCandidateEmployment] 
AS 
SELECT 
    jc.[JobCandidateID] 
    ,CONVERT(datetime, REPLACE([Employment].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Emp.StartDate)[1]', 'nvarchar(20)') ,'Z', ''), 101) AS [Emp.StartDate] 
    ,CONVERT(datetime, REPLACE([Employment].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Emp.EndDate)[1]', 'nvarchar(20)') ,'Z', ''), 101) AS [Emp.EndDate] 
    ,[Employment].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Emp.OrgName)[1]', 'nvarchar(100)') AS [Emp.OrgName]
    ,[Employment].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Emp.JobTitle)[1]', 'nvarchar(100)') AS [Emp.JobTitle]
    ,[Employment].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Emp.Responsibility)[1]', 'nvarchar(max)') AS [Emp.Responsibility]
    ,[Employment].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Emp.FunctionCategory)[1]', 'nvarchar(max)') AS [Emp.FunctionCategory]
    ,[Employment].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Emp.IndustryCategory)[1]', 'nvarchar(max)') AS [Emp.IndustryCategory]
    ,[Employment].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Emp.Location/Location/Loc.CountryRegion)[1]', 'nvarchar(max)') AS [Emp.Loc.CountryRegion]
    ,[Employment].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Emp.Location/Location/Loc.State)[1]', 'nvarchar(max)') AS [Emp.Loc.State]
    ,[Employment].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        (Emp.Location/Location/Loc.City)[1]', 'nvarchar(max)') AS [Emp.Loc.City]
FROM [HumanResources].[JobCandidate] jc 
CROSS APPLY jc.[Resume].nodes(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
    /Resume/Employment') AS Employment(ref);
Tables Used in View
Table CatalogTable SchemaTable Name
AdventureWorksHumanResourcesJobCandidate
Dependent Objects
Dependent ObjDependent Obj Type
JobCandidateUSER_TABLE
vAdditionalContactInfo
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
Citynvarchar50 YES
ContactIDint NO
CountryRegionnvarchar50 YES
EMailAddressnvarchar128 YES
EMailSpecialInstructionsnvarchar-1 YES
EMailTelephoneNumbernvarchar50 YES
FirstNamenvarchar50 NO
HomeAddressSpecialInstructionsnvarchar-1 YES
LastNamenvarchar50 NO
MiddleNamenvarchar50 YES
ModifiedDatedatetime NO
PostalCodenvarchar50 YES
rowguiduniqueidentifier NO
StateProvincenvarchar50 YES
Streetnvarchar50 YES
TelephoneNumbernvarchar50 YES
TelephoneSpecialInstructionsnvarchar-1 YES
View Definition
View Definition

CREATE VIEW [Person].[vAdditionalContactInfo] 
AS 
SELECT 
    [ContactID] 
    ,[FirstName]
    ,[MiddleName]
    ,[LastName]
    ,[ContactInfo].ref.value(N'declare namespace ci="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo"; 
        declare namespace act="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes"; 
        (act:telephoneNumber)[1]/act:number', 'nvarchar(50)') AS [TelephoneNumber] 
    ,LTRIM(RTRIM([ContactInfo].ref.value(N'declare namespace ci="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo"; 
        declare namespace act="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes"; 
        (act:telephoneNumber/act:SpecialInstructions/text())[1]', 'nvarchar(max)'))) AS [TelephoneSpecialInstructions] 
    ,[ContactInfo].ref.value(N'declare namespace ci="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo"; 
        declare namespace act="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes";
        (act:homePostalAddress/act:Street)[1]', 'nvarchar(50)') AS [Street] 
    ,[ContactInfo].ref.value(N'declare namespace ci="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo"; 
        declare namespace act="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes"; 
        (act:homePostalAddress/act:City)[1]', 'nvarchar(50)') AS [City] 
    ,[ContactInfo].ref.value(N'declare namespace ci="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo"; 
        declare namespace act="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes"; 
        (act:homePostalAddress/act:StateProvince)[1]', 'nvarchar(50)') AS [StateProvince] 
    ,[ContactInfo].ref.value(N'declare namespace ci="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo"; 
        declare namespace act="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes"; 
        (act:homePostalAddress/act:PostalCode)[1]', 'nvarchar(50)') AS [PostalCode] 
    ,[ContactInfo].ref.value(N'declare namespace ci="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo"; 
        declare namespace act="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes"; 
        (act:homePostalAddress/act:CountryRegion)[1]', 'nvarchar(50)') AS [CountryRegion] 
    ,[ContactInfo].ref.value(N'declare namespace ci="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo"; 
        declare namespace act="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes"; 
        (act:homePostalAddress/act:SpecialInstructions/text())[1]', 'nvarchar(max)') AS [HomeAddressSpecialInstructions] 
    ,[ContactInfo].ref.value(N'declare namespace ci="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo"; 
        declare namespace act="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes"; 
        (act:eMail/act:eMailAddress)[1]', 'nvarchar(128)') AS [EMailAddress] 
    ,LTRIM(RTRIM([ContactInfo].ref.value(N'declare namespace ci="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo"; 
        declare namespace act="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes"; 
        (act:eMail/act:SpecialInstructions/text())[1]', 'nvarchar(max)'))) AS [EMailSpecialInstructions] 
    ,[ContactInfo].ref.value(N'declare namespace ci="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo"; 
        declare namespace act="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes"; 
        (act:eMail/act:SpecialInstructions/act:telephoneNumber/act:number)[1]', 'nvarchar(50)') AS [EMailTelephoneNumber] 
    ,[rowguid] 
    ,[ModifiedDate]
FROM [Person].[Contact]
OUTER APPLY [AdditionalContactInfo].nodes(
Tables Used in View
Table CatalogTable SchemaTable Name
AdventureWorksPersonContact
Dependent Objects
Dependent ObjDependent Obj Type
ContactUSER_TABLE
vStateProvinceCountryRegion
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
CountryRegionCodenvarchar3 NO
CountryRegionNamenvarchar50 NO
IsOnlyStateProvinceFlagbit NO
StateProvinceCodenchar3 NO
StateProvinceIDint NOClustered index on the view vStateProvinceCountryRegion.
StateProvinceNamenvarchar50 NO
TerritoryIDint NO
View Definition
View Definition

CREATE VIEW [Person].[vStateProvinceCountryRegion] 
WITH SCHEMABINDING 
AS 
SELECT 
    sp.[StateProvinceID] 
    ,sp.[StateProvinceCode] 
    ,sp.[IsOnlyStateProvinceFlag] 
    ,sp.[Name] AS [StateProvinceName] 
    ,sp.[TerritoryID] 
    ,cr.[CountryRegionCode] 
    ,cr.[Name] AS [CountryRegionName]
FROM [Person].[StateProvince] sp 
    INNER JOIN [Person].[CountryRegion] cr 
    ON sp.[CountryRegionCode] = cr.[CountryRegionCode];
Tables Used in View
Table CatalogTable SchemaTable Name
AdventureWorksPersonCountryRegion
AdventureWorksPersonStateProvince
Dependent Objects
Dependent ObjDependent Obj Type
CountryRegionUSER_TABLE
StateProvinceUSER_TABLE
vProductAndDescription
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
CultureIDnchar6 NO
Descriptionnvarchar400 NO
Namenvarchar50 NO
ProductIDint NOClustered index on the view vProductAndDescription.
ProductModelnvarchar50 NO
View Definition
View Definition

CREATE VIEW [Production].[vProductAndDescription] 
WITH SCHEMABINDING 
AS 
-- View (indexed or standard) to display products and product descriptions by language.
SELECT 
    p.[ProductID] 
    ,p.[Name] 
    ,pm.[Name] AS [ProductModel] 
    ,pmx.[CultureID] 
    ,pd.[Description] 
FROM [Production].[Product] p 
    INNER JOIN [Production].[ProductModel] pm 
    ON p.[ProductModelID] = pm.[ProductModelID] 
    INNER JOIN [Production].[ProductModelProductDescriptionCulture] pmx 
    ON pm.[ProductModelID] = pmx.[ProductModelID] 
    INNER JOIN [Production].[ProductDescription] pd 
    ON pmx.[ProductDescriptionID] = pd.[ProductDescriptionID];
Tables Used in View
Table CatalogTable SchemaTable Name
AdventureWorksProductionProduct
AdventureWorksProductionProductDescription
AdventureWorksProductionProductModel
AdventureWorksProductionProductModelProductDescriptionCulture
Dependent Objects
Dependent ObjDependent Obj Type
ProductUSER_TABLE
ProductDescriptionUSER_TABLE
ProductModelUSER_TABLE
ProductModelProductDescriptionCultureUSER_TABLE
vProductModelCatalogDescription
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
BikeFramenvarchar-1 YES
Colornvarchar256 YES
Copyrightnvarchar30 YES
Cranksetnvarchar256 YES
MaintenanceDescriptionnvarchar256 YES
Manufacturernvarchar-1 YES
Materialnvarchar256 YES
ModifiedDatedatetime NO
Namenvarchar50 NO
NoOfYearsnvarchar256 YES
Pedalnvarchar256 YES
PictureAnglenvarchar256 YES
PictureSizenvarchar256 YES
ProductLinenvarchar256 YES
ProductModelIDint NO
ProductPhotoIDnvarchar256 YES
ProductURLnvarchar256 YES
RiderExperiencenvarchar1024 YES
rowguiduniqueidentifier NO
Saddlenvarchar256 YES
Stylenvarchar256 YES
Summarynvarchar-1 YES
WarrantyDescriptionnvarchar256 YES
WarrantyPeriodnvarchar256 YES
Wheelnvarchar256 YES
View Definition
View Definition

CREATE VIEW [Production].[vProductModelCatalogDescription] 
AS 
SELECT 
    [ProductModelID] 
    ,[Name] 
    ,[CatalogDescription].value(N'declare namespace p1="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription"; 
        declare namespace html="http://www.w3.org/1999/xhtml"; 
        (/p1:ProductDescription/p1:Summary/html:p)[1]', 'nvarchar(max)') AS [Summary] 
    ,[CatalogDescription].value(N'declare namespace p1="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription"; 
        (/p1:ProductDescription/p1:Manufacturer/p1:Name)[1]', 'nvarchar(max)') AS [Manufacturer] 
    ,[CatalogDescription].value(N'declare namespace p1="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription"; 
        (/p1:ProductDescription/p1:Manufacturer/p1:Copyright)[1]', 'nvarchar(30)') AS [Copyright] 
    ,[CatalogDescription].value(N'declare namespace p1="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription"; 
        (/p1:ProductDescription/p1:Manufacturer/p1:ProductURL)[1]', 'nvarchar(256)') AS [ProductURL] 
    ,[CatalogDescription].value(N'declare namespace p1="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription"; 
        declare namespace wm="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelWarrAndMain"; 
        (/p1:ProductDescription/p1:Features/wm:Warranty/wm:WarrantyPeriod)[1]', 'nvarchar(256)') AS [WarrantyPeriod] 
    ,[CatalogDescription].value(N'declare namespace p1="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription"; 
        declare namespace wm="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelWarrAndMain"; 
        (/p1:ProductDescription/p1:Features/wm:Warranty/wm:Description)[1]', 'nvarchar(256)') AS [WarrantyDescription] 
    ,[CatalogDescription].value(N'declare namespace p1="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription"; 
        declare namespace wm="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelWarrAndMain"; 
        (/p1:ProductDescription/p1:Features/wm:Maintenance/wm:NoOfYears)[1]', 'nvarchar(256)') AS [NoOfYears] 
    ,[CatalogDescription].value(N'declare namespace p1="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription"; 
        declare namespace wm="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelWarrAndMain"; 
        (/p1:ProductDescription/p1:Features/wm:Maintenance/wm:Description)[1]', 'nvarchar(256)') AS [MaintenanceDescription] 
    ,[CatalogDescription].value(N'declare namespace p1="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription"; 
        declare namespace wf="http://www.adventure-works.com/schemas/OtherFeatures"; 
        (/p1:ProductDescription/p1:Features/wf:wheel)[1]', 'nvarchar(256)') AS [Wheel] 
    ,[CatalogDescription].value(N'declare namespace p1="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription"; 
        declare namespace wf="http://www.adventure-works.com/schemas/OtherFeatures"; 
        (/p1:ProductDescription/p1:Features/wf:saddle)[1]', 'nvarchar(256)') AS [Saddle] 
    ,[CatalogDescription].value(N'declare namespace p1="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription"; 
        declare namespace wf="http://www.adventure-works.com/schemas/OtherFeatures"; 
        (/p1:ProductDescription/p1:Features/wf:pedal)[1]', 'nvarchar(256)') AS [Pedal] 
    ,[CatalogDescription].value(N'declare namespace p1="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription"; 
        declare namespace wf="http://www.adventure-works.com/schemas/OtherFeatures"; 
        (/p1:ProductDescription/p1:Features/wf:BikeFrame)[1]', 'nvarchar(max)') AS [Bik
Tables Used in View
Table CatalogTable SchemaTable Name
AdventureWorksProductionProductModel
Dependent Objects
Dependent ObjDependent Obj Type
ProductModelUSER_TABLE
vProductModelInstructions
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
Instructionsnvarchar-1 YES
LaborHoursdecimal YES
LocationIDint YES
LotSizeint YES
MachineHoursdecimal YES
ModifiedDatedatetime NO
Namenvarchar50 NO
ProductModelIDint NO
rowguiduniqueidentifier NO
SetupHoursdecimal YES
Stepnvarchar1024 YES
View Definition
View Definition

CREATE VIEW [Production].[vProductModelInstructions] 
AS 
SELECT 
    [ProductModelID] 
    ,[Name] 
    ,[Instructions].value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelManuInstructions"; 
        (/root/text())[1]', 'nvarchar(max)') AS [Instructions] 
    ,[MfgInstructions].ref.value('@LocationID[1]', 'int') AS [LocationID] 
    ,[MfgInstructions].ref.value('@SetupHours[1]', 'decimal(9, 4)') AS [SetupHours] 
    ,[MfgInstructions].ref.value('@MachineHours[1]', 'decimal(9, 4)') AS [MachineHours] 
    ,[MfgInstructions].ref.value('@LaborHours[1]', 'decimal(9, 4)') AS [LaborHours] 
    ,[MfgInstructions].ref.value('@LotSize[1]', 'int') AS [LotSize] 
    ,[Steps].ref.value('string(.)[1]', 'nvarchar(1024)') AS [Step] 
    ,[rowguid] 
    ,[ModifiedDate]
FROM [Production].[ProductModel] 
CROSS APPLY [Instructions].nodes(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelManuInstructions"; 
    /root/Location') MfgInstructions(ref)
CROSS APPLY [MfgInstructions].ref.nodes('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelManuInstructions"; 
    step') Steps(ref);
Tables Used in View
Table CatalogTable SchemaTable Name
AdventureWorksProductionProductModel
Dependent Objects
Dependent ObjDependent Obj Type
ProductModelUSER_TABLE
vVendor
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
AddressLine1nvarchar60 NO
AddressLine2nvarchar60 YES
Citynvarchar30 NO
ContactTypenvarchar50 NO
CountryRegionNamenvarchar50 NO
EmailAddressnvarchar50 YES
EmailPromotionint NO
FirstNamenvarchar50 NO
LastNamenvarchar50 NO
MiddleNamenvarchar50 YES
Namenvarchar50 NO
Phonenvarchar25 YES
PostalCodenvarchar15 NO
StateProvinceNamenvarchar50 NO
Suffixnvarchar10 YES
Titlenvarchar8 YES
VendorIDint NO
View Definition
View Definition

CREATE VIEW [Purchasing].[vVendor] AS 
SELECT 
    v.[VendorID]
    ,v.[Name]
    ,ct.[Name] AS [ContactType]
    ,c.[Title]
    ,c.[FirstName]
    ,c.[MiddleName]
    ,c.[LastName]
    ,c.[Suffix]
    ,c.[Phone]
    ,c.[EmailAddress]
    ,c.[EmailPromotion]
    ,a.[AddressLine1]
    ,a.[AddressLine2]
    ,a.[City]
    ,[StateProvinceName] = sp.[Name]
    ,a.[PostalCode]
    ,[CountryRegionName] = cr.[Name]
FROM [Purchasing].[Vendor] v
    INNER JOIN [Purchasing].[VendorContact] vc 
    ON vc.[VendorID] = v.[VendorID]
    INNER JOIN [Person].[Contact] c 
    ON c.[ContactID] = vc.[ContactID]
    INNER JOIN [Person].[ContactType] ct 
    ON vc.[ContactTypeID] = ct.[ContactTypeID]
    INNER JOIN [Purchasing].[VendorAddress] va 
    ON va.[VendorID] = v.[VendorID]
    INNER JOIN [Person].[Address] a 
    ON a.[AddressID] = va.[AddressID]
    INNER JOIN [Person].[StateProvince] sp 
    ON sp.[StateProvinceID] = a.[StateProvinceID]
    INNER JOIN [Person].[CountryRegion] cr 
    ON cr.[CountryRegionCode] = sp.[CountryRegionCode];
Tables Used in View
Table CatalogTable SchemaTable Name
AdventureWorksPersonAddress
AdventureWorksPersonContact
AdventureWorksPersonContactType
AdventureWorksPersonCountryRegion
AdventureWorksPersonStateProvince
AdventureWorksPurchasingVendor
AdventureWorksPurchasingVendorAddress
AdventureWorksPurchasingVendorContact
Dependent Objects
Dependent ObjDependent Obj Type
AddressUSER_TABLE
ContactUSER_TABLE
ContactTypeUSER_TABLE
CountryRegionUSER_TABLE
StateProvinceUSER_TABLE
VendorUSER_TABLE
VendorAddressUSER_TABLE
VendorContactUSER_TABLE
vIndividualCustomer
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
AddressLine1nvarchar60 NO
AddressLine2nvarchar60 YES
AddressTypenvarchar50 NO
Citynvarchar30 NO
CountryRegionNamenvarchar50 NO
CustomerIDint NO
Demographicsxml-1 YES
EmailAddressnvarchar50 YES
EmailPromotionint NO
FirstNamenvarchar50 NO
LastNamenvarchar50 NO
MiddleNamenvarchar50 YES
Phonenvarchar25 YES
PostalCodenvarchar15 NO
StateProvinceNamenvarchar50 NO
Suffixnvarchar10 YES
Titlenvarchar8 YES
View Definition
View Definition

CREATE VIEW [Sales].[vIndividualCustomer] 
AS 
SELECT 
    i.[CustomerID]
    ,c.[Title]
    ,c.[FirstName]
    ,c.[MiddleName]
    ,c.[LastName]
    ,c.[Suffix]
    ,c.[Phone]
    ,c.[EmailAddress]
    ,c.[EmailPromotion]
    ,at.[Name] AS [AddressType]
    ,a.[AddressLine1]
    ,a.[AddressLine2]
    ,a.[City]
    ,[StateProvinceName] = sp.[Name]
    ,a.[PostalCode]
    ,[CountryRegionName] = cr.[Name]
    ,i.[Demographics]
FROM [Sales].[Individual] i
    INNER JOIN [Person].[Contact] c 
    ON c.[ContactID] = i.[ContactID]
    INNER JOIN [Sales].[CustomerAddress] ca 
    ON ca.[CustomerID] = i.[CustomerID]
    INNER JOIN [Person].[Address] a 
    ON a.[AddressID] = ca.[AddressID]
    INNER JOIN [Person].[StateProvince] sp 
    ON sp.[StateProvinceID] = a.[StateProvinceID]
    INNER JOIN [Person].[CountryRegion] cr 
    ON cr.[CountryRegionCode] = sp.[CountryRegionCode]
    INNER JOIN [Person].[AddressType] at 
    ON ca.[AddressTypeID] = at.[AddressTypeID]
WHERE i.[CustomerID] IN (SELECT [Sales].[Customer].[CustomerID] 
    FROM [Sales].[Customer] WHERE UPPER([Sales].[Customer].[CustomerType]) = 'I');
Tables Used in View
Table CatalogTable SchemaTable Name
AdventureWorksPersonAddress
AdventureWorksPersonAddressType
AdventureWorksPersonContact
AdventureWorksPersonCountryRegion
AdventureWorksPersonStateProvince
AdventureWorksSalesCustomer
AdventureWorksSalesCustomerAddress
AdventureWorksSalesIndividual
Dependent Objects
Dependent ObjDependent Obj Type
AddressUSER_TABLE
AddressTypeUSER_TABLE
ContactUSER_TABLE
CountryRegionUSER_TABLE
CustomerUSER_TABLE
CustomerAddressUSER_TABLE
IndividualUSER_TABLE
StateProvinceUSER_TABLE
vIndividualDemographics
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
BirthDatedatetime YES
CustomerIDint NO
DateFirstPurchasedatetime YES
Educationnvarchar30 YES
Gendernvarchar1 YES
HomeOwnerFlagbit YES
MaritalStatusnvarchar1 YES
NumberCarsOwnedint YES
NumberChildrenAtHomeint YES
Occupationnvarchar30 YES
TotalChildrenint YES
TotalPurchaseYTDmoney YES
YearlyIncomenvarchar30 YES
View Definition
View Definition

CREATE VIEW [Sales].[vIndividualDemographics] 
AS 
SELECT 
    i.[CustomerID] 
    ,[IndividualSurvey].[ref].[value](N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey"; 
        TotalPurchaseYTD[1]', 'money') AS [TotalPurchaseYTD] 
    ,CONVERT(datetime, REPLACE([IndividualSurvey].[ref].[value](N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey"; 
        DateFirstPurchase[1]', 'nvarchar(20)') ,'Z', ''), 101) AS [DateFirstPurchase] 
    ,CONVERT(datetime, REPLACE([IndividualSurvey].[ref].[value](N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey"; 
        BirthDate[1]', 'nvarchar(20)') ,'Z', ''), 101) AS [BirthDate] 
    ,[IndividualSurvey].[ref].[value](N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey"; 
        MaritalStatus[1]', 'nvarchar(1)') AS [MaritalStatus] 
    ,[IndividualSurvey].[ref].[value](N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey"; 
        YearlyIncome[1]', 'nvarchar(30)') AS [YearlyIncome] 
    ,[IndividualSurvey].[ref].[value](N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey"; 
        Gender[1]', 'nvarchar(1)') AS [Gender] 
    ,[IndividualSurvey].[ref].[value](N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey"; 
        TotalChildren[1]', 'integer') AS [TotalChildren] 
    ,[IndividualSurvey].[ref].[value](N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey"; 
        NumberChildrenAtHome[1]', 'integer') AS [NumberChildrenAtHome] 
    ,[IndividualSurvey].[ref].[value](N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey"; 
        Education[1]', 'nvarchar(30)') AS [Education] 
    ,[IndividualSurvey].[ref].[value](N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey"; 
        Occupation[1]', 'nvarchar(30)') AS [Occupation] 
    ,[IndividualSurvey].[ref].[value](N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey"; 
        HomeOwnerFlag[1]', 'bit') AS [HomeOwnerFlag] 
    ,[IndividualSurvey].[ref].[value](N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey"; 
        NumberCarsOwned[1]', 'integer') AS [NumberCarsOwned] 
FROM [Sales].[Individual] i 
CROSS APPLY i.[Demographics].nodes(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey"; 
    /IndividualSurvey') AS [IndividualSurvey](ref) 
WHERE [Demographics] IS NOT NULL;
Tables Used in View
Table CatalogTable SchemaTable Name
AdventureWorksSalesIndividual
Dependent Objects
Dependent ObjDependent Obj Type
IndividualUSER_TABLE
vSalesPerson
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
AddressLine1nvarchar60 NO
AddressLine2nvarchar60 YES
Citynvarchar30 NO
CountryRegionNamenvarchar50 NO
EmailAddressnvarchar50 YES
EmailPromotionint NO
FirstNamenvarchar50 NO
JobTitlenvarchar50 NO
LastNamenvarchar50 NO
MiddleNamenvarchar50 YES
Phonenvarchar25 YES
PostalCodenvarchar15 NO
SalesLastYearmoney NO
SalesPersonIDint NO
SalesQuotamoney YES
SalesYTDmoney NO
StateProvinceNamenvarchar50 NO
Suffixnvarchar10 YES
TerritoryGroupnvarchar50 YES
TerritoryNamenvarchar50 YES
Titlenvarchar8 YES
View Definition
View Definition

CREATE VIEW [Sales].[vSalesPerson] 
AS 
SELECT 
    s.[SalesPersonID]
    ,c.[Title]
    ,c.[FirstName]
    ,c.[MiddleName]
    ,c.[LastName]
    ,c.[Suffix]
    ,[JobTitle] = e.[Title]
    ,c.[Phone]
    ,c.[EmailAddress]
    ,c.[EmailPromotion]
    ,a.[AddressLine1]
    ,a.[AddressLine2]
    ,a.[City]
    ,[StateProvinceName] = sp.[Name]
    ,a.[PostalCode]
    ,[CountryRegionName] = cr.[Name]
    ,[TerritoryName] = st.[Name]
    ,[TerritoryGroup] = st.[Group]
    ,s.[SalesQuota]
    ,s.[SalesYTD]
    ,s.[SalesLastYear]
FROM [Sales].[SalesPerson] s
    INNER JOIN [HumanResources].[Employee] e 
    ON e.[EmployeeID] = s.[SalesPersonID]
    LEFT OUTER JOIN [Sales].[SalesTerritory] st 
    ON st.[TerritoryID] = s.[TerritoryID]
    INNER JOIN [Person].[Contact] c 
    ON c.[ContactID] = e.[ContactID]
    INNER JOIN [HumanResources].[EmployeeAddress] ea 
    ON e.[EmployeeID] = ea.[EmployeeID] 
    INNER JOIN [Person].[Address] a 
    ON ea.[AddressID] = a.[AddressID]
    INNER JOIN [Person].[StateProvince] sp 
    ON sp.[StateProvinceID] = a.[StateProvinceID]
    INNER JOIN [Person].[CountryRegion] cr 
    ON cr.[CountryRegionCode] = sp.[CountryRegionCode];
Tables Used in View
Table CatalogTable SchemaTable Name
AdventureWorksHumanResourcesEmployee
AdventureWorksHumanResourcesEmployeeAddress
AdventureWorksPersonAddress
AdventureWorksPersonContact
AdventureWorksPersonCountryRegion
AdventureWorksPersonStateProvince
AdventureWorksSalesSalesPerson
AdventureWorksSalesSalesTerritory
Dependent Objects
Dependent ObjDependent Obj Type
AddressUSER_TABLE
ContactUSER_TABLE
CountryRegionUSER_TABLE
EmployeeUSER_TABLE
EmployeeAddressUSER_TABLE
SalesPersonUSER_TABLE
SalesTerritoryUSER_TABLE
StateProvinceUSER_TABLE
vSalesPersonSalesByFiscalYears
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
2002money YES
2003money YES
2004money YES
FullNamenvarchar152 YES
SalesPersonIDint YES
SalesTerritorynvarchar50 NO
Titlenvarchar50 NO
View Definition
View Definition

CREATE VIEW [Sales].[vSalesPersonSalesByFiscalYears] 
AS 
SELECT 
    pvt.[SalesPersonID]
    ,pvt.[FullName]
    ,pvt.[Title]
    ,pvt.[SalesTerritory]
    ,pvt.[2002]
    ,pvt.[2003]
    ,pvt.[2004] 
FROM (SELECT 
        soh.[SalesPersonID]
        ,c.[FirstName] + ' ' + COALESCE(c.[MiddleName], '') + ' ' + c.[LastName] AS [FullName]
        ,e.[Title]
        ,st.[Name] AS [SalesTerritory]
        ,soh.[SubTotal]
        ,YEAR(DATEADD(m, 6, soh.[OrderDate])) AS [FiscalYear] 
    FROM [Sales].[SalesPerson] sp 
        INNER JOIN [Sales].[SalesOrderHeader] soh 
        ON sp.[SalesPersonID] = soh.[SalesPersonID]
        INNER JOIN [Sales].[SalesTerritory] st 
        ON sp.[TerritoryID] = st.[TerritoryID] 
        INNER JOIN [HumanResources].[Employee] e 
        ON soh.[SalesPersonID] = e.[EmployeeID] 
        INNER JOIN [Person].[Contact] c 
        ON e.[ContactID] = c.ContactID 
    ) AS soh 
PIVOT 
(
    SUM([SubTotal]) 
    FOR [FiscalYear] 
    IN ([2002], [2003], [2004])
) AS pvt;
Tables Used in View
Table CatalogTable SchemaTable Name
AdventureWorksHumanResourcesEmployee
AdventureWorksPersonContact
AdventureWorksSalesSalesOrderHeader
AdventureWorksSalesSalesPerson
AdventureWorksSalesSalesTerritory
Dependent Objects
Dependent ObjDependent Obj Type
ContactUSER_TABLE
EmployeeUSER_TABLE
SalesOrderHeaderUSER_TABLE
SalesPersonUSER_TABLE
SalesTerritoryUSER_TABLE
vStoreWithDemographics
Column Details
Column NameData TypeLengthColumn DefaultIs NullableDescription
AddressLine1nvarchar60 NO
AddressLine2nvarchar60 YES
AddressTypenvarchar50 NO
AnnualRevenuemoney YES
AnnualSalesmoney YES
BankNamenvarchar50 YES
Brandsnvarchar30 YES
BusinessTypenvarchar5 YES
Citynvarchar30 NO
ContactTypenvarchar50 NO
CountryRegionNamenvarchar50 NO
CustomerIDint NO
EmailAddressnvarchar50 YES
EmailPromotionint NO
FirstNamenvarchar50 NO
Internetnvarchar30 YES
LastNamenvarchar50 NO
MiddleNamenvarchar50 YES
Namenvarchar50 NO
NumberEmployeesint YES
Phonenvarchar25 YES
PostalCodenvarchar15 NO
Specialtynvarchar50 YES
SquareFeetint YES
StateProvinceNamenvarchar50 NO
Suffixnvarchar10 YES
Titlenvarchar8 YES
YearOpenedint YES
View Definition
View Definition

CREATE VIEW [Sales].[vStoreWithDemographics] AS 
SELECT 
    s.[CustomerID] 
    ,s.[Name] 
    ,ct.[Name] AS [ContactType] 
    ,c.[Title] 
    ,c.[FirstName] 
    ,c.[MiddleName] 
    ,c.[LastName] 
    ,c.[Suffix] 
    ,c.[Phone] 
    ,c.[EmailAddress] 
    ,c.[EmailPromotion] 
    ,at.[Name] AS [AddressType]
    ,a.[AddressLine1] 
    ,a.[AddressLine2] 
    ,a.[City] 
    ,sp.[Name] AS [StateProvinceName] 
    ,a.[PostalCode] 
    ,cr.[Name] AS [CountryRegionName] 
    ,s.[Demographics].value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"; 
        (/StoreSurvey/AnnualSales)[1]', 'money') AS [AnnualSales] 
    ,s.[Demographics].value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"; 
        (/StoreSurvey/AnnualRevenue)[1]', 'money') AS [AnnualRevenue] 
    ,s.[Demographics].value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"; 
        (/StoreSurvey/BankName)[1]', 'nvarchar(50)') AS [BankName] 
    ,s.[Demographics].value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"; 
        (/StoreSurvey/BusinessType)[1]', 'nvarchar(5)') AS [BusinessType] 
    ,s.[Demographics].value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"; 
        (/StoreSurvey/YearOpened)[1]', 'integer') AS [YearOpened] 
    ,s.[Demographics].value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"; 
        (/StoreSurvey/Specialty)[1]', 'nvarchar(50)') AS [Specialty] 
    ,s.[Demographics].value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"; 
        (/StoreSurvey/SquareFeet)[1]', 'integer') AS [SquareFeet] 
    ,s.[Demographics].value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"; 
        (/StoreSurvey/Brands)[1]', 'nvarchar(30)') AS [Brands] 
    ,s.[Demographics].value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"; 
        (/StoreSurvey/Internet)[1]', 'nvarchar(30)') AS [Internet] 
    ,s.[Demographics].value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"; 
        (/StoreSurvey/NumberEmployees)[1]', 'integer') AS [NumberEmployees] 
FROM [Sales].[Store] s
    INNER JOIN [Sales].[StoreContact] sc 
    ON sc.[CustomerID] = s.[CustomerID]
    INNER JOIN [Person].[Contact] c 
    ON c.[ContactID] = sc.[ContactID]
    INNER JOIN [Person].[ContactType] ct 
    ON sc.[ContactTypeID] = ct.[ContactTypeID]
    INNER JOIN [Sales].[CustomerAddress] ca 
    ON ca.[CustomerID] = s.[CustomerID]
    INNER JOIN [Person].[Address] a 
    ON a.[AddressID] = ca.[AddressID]
    INNER JOIN [Person].[StateProvince] sp 
    ON sp.[StateProvinceID] = a.[StateProvinceID]
    INNER JOIN [Person].[CountryRegion] cr 
    ON cr.[CountryRegionCode] = sp.[CountryRegionCode]
    INNER JOIN [Person].[AddressType] at 
    ON ca.[AddressTypeID] = at.[AddressTypeID]
WHERE s.[CustomerID] IN (SELECT [Sales].[Customer].[CustomerID] 
    FROM [Sales].[Customer] WHERE UPPER([Sales].[Customer].[CustomerType]) = 'S');
Tables Used in View
Table CatalogTable SchemaTable Name
AdventureWorksPersonAddress
AdventureWorksPersonAddressType
AdventureWorksPersonContact
AdventureWorksPersonContactType
AdventureWorksPersonCountryRegion
AdventureWorksPersonStateProvince
AdventureWorksSalesCustomer
AdventureWorksSalesCustomerAddress
AdventureWorksSalesStore
AdventureWorksSalesStoreContact
Dependent Objects
Dependent ObjDependent Obj Type
AddressUSER_TABLE
AddressTypeUSER_TABLE
ContactUSER_TABLE
ContactTypeUSER_TABLE
CountryRegionUSER_TABLE
CustomerUSER_TABLE
CustomerAddressUSER_TABLE
StateProvinceUSER_TABLE
StoreUSER_TABLE
StoreContactUSER_TABLE
Procedures
Procedure NameProcedure Schema
uspPrintErrordbo
uspLogErrordbo
uspGetBillOfMaterialsdbo
uspGetEmployeeManagersdbo
uspGetManagerEmployeesdbo
uspGetWhereUsedProductIDdbo
uspUpdateEmployeeHireInfoHumanResources
uspUpdateEmployeeLoginHumanResources
uspUpdateEmployeePersonalInfoHumanResources
uspPrintError
Definition
Routine Definition

-- uspPrintError prints error information about the error that caused 
-- execution to jump to the CATCH block of a TRY...CATCH construct. 
-- Should be executed from within the scope of a CATCH block otherwise 
-- it will return without printing any error information.
CREATE PROCEDURE [dbo].[uspPrintError] 
AS
BEGIN
    SET NOCOUNT ON;

    -- Print error information. 
    PRINT 'Error ' + CONVERT(varchar(50), ERROR_NUMBER()) +
          ', Severity ' + CONVERT(varchar(5), ERROR_SEVERITY()) +
          ', State ' + CONVERT(varchar(5), ERROR_STATE()) + 
          ', Procedure ' + ISNULL(ERROR_PROCEDURE(), '-') + 
          ', Line ' + CONVERT(varchar(5), ERROR_LINE());
    PRINT ERROR_MESSAGE();
END;
Dependent Objects
Dependent ObjDependent Obj Type
uspLogErrorSQL_STORED_PROCEDURE
dVendorSQL_TRIGGER
iduSalesOrderDetailSQL_TRIGGER
iPurchaseOrderDetailSQL_TRIGGER
iStoreSQL_TRIGGER
iWorkOrderSQL_TRIGGER
uPurchaseOrderDetailSQL_TRIGGER
uPurchaseOrderHeaderSQL_TRIGGER
uSalesOrderHeaderSQL_TRIGGER
uWorkOrderSQL_TRIGGER
uspLogError
Definition
Routine Definition

-- uspLogError logs error information in the ErrorLog table about the 
-- error that caused execution to jump to the CATCH block of a 
-- TRY...CATCH construct. This should be executed from within the scope 
-- of a CATCH block otherwise it will return without inserting error 
-- information. 
CREATE PROCEDURE [dbo].[uspLogError] 
    @ErrorLogID [int] = 0 OUTPUT -- contains the ErrorLogID of the row inserted
AS                               -- by uspLogError in the ErrorLog table
BEGIN
    SET NOCOUNT ON;

    -- Output parameter value of 0 indicates that error 
    -- information was not logged
    SET @ErrorLogID = 0;

    BEGIN TRY
        -- Return if there is no error information to log
        IF ERROR_NUMBER() IS NULL
            RETURN;

        -- Return if inside an uncommittable transaction.
        -- Data insertion/modification is not allowed when 
        -- a transaction is in an uncommittable state.
        IF XACT_STATE() = -1
        BEGIN
            PRINT 'Cannot log error since the current transaction is in an uncommittable state. ' 
                + 'Rollback the transaction before executing uspLogError in order to successfully log error information.';
            RETURN;
        END

        INSERT [dbo].[ErrorLog] 
            (
            [UserName], 
            [ErrorNumber], 
            [ErrorSeverity], 
            [ErrorState], 
            [ErrorProcedure], 
            [ErrorLine], 
            [ErrorMessage]
            ) 
        VALUES 
            (
            CONVERT(sysname, CURRENT_USER), 
            ERROR_NUMBER(),
            ERROR_SEVERITY(),
            ERROR_STATE(),
            ERROR_PROCEDURE(),
            ERROR_LINE(),
            ERROR_MESSAGE()
            );

        -- Pass back the ErrorLogID of the row inserted
        SET @ErrorLogID = @@IDENTITY;
    END TRY
    BEGIN CATCH
        PRINT 'An error occurred in stored procedure uspLogError: ';
        EXECUTE [dbo].[uspPrintError];
        RETURN -1;
    END CATCH
END;
Dependent Objects
Dependent ObjDependent Obj Type
uspPrintErrorSQL_STORED_PROCEDURE
uspUpdateEmployeeHireInfoSQL_STORED_PROCEDURE
uspUpdateEmployeeLoginSQL_STORED_PROCEDURE
uspUpdateEmployeePersonalInfoSQL_STORED_PROCEDURE
dVendorSQL_TRIGGER
iduSalesOrderDetailSQL_TRIGGER
iPurchaseOrderDetailSQL_TRIGGER
iStoreSQL_TRIGGER
iWorkOrderSQL_TRIGGER
uPurchaseOrderDetailSQL_TRIGGER
uPurchaseOrderHeaderSQL_TRIGGER
uSalesOrderHeaderSQL_TRIGGER
uWorkOrderSQL_TRIGGER
ErrorLogUSER_TABLE
uspGetBillOfMaterials
Definition
Routine Definition

CREATE PROCEDURE [dbo].[uspGetBillOfMaterials]
    @StartProductID [int],
    @CheckDate [datetime]
AS
BEGIN
    SET NOCOUNT ON;

    -- Use recursive query to generate a multi-level Bill of Material (i.e. all level 1 
    -- components of a level 0 assembly, all level 2 components of a level 1 assembly)
    -- The CheckDate eliminates any components that are no longer used in the product on this date.
    WITH [BOM_cte]([ProductAssemblyID], [ComponentID], [ComponentDesc], [PerAssemblyQty], [StandardCost], [ListPrice], [BOMLevel], [RecursionLevel]) -- CTE name and columns
    AS (
        SELECT b.[ProductAssemblyID], b.[ComponentID], p.[Name], b.[PerAssemblyQty], p.[StandardCost], p.[ListPrice], b.[BOMLevel], 0 -- Get the initial list of components for the bike assembly
        FROM [Production].[BillOfMaterials] b
            INNER JOIN [Production].[Product] p 
            ON b.[ComponentID] = p.[ProductID] 
        WHERE b.[ProductAssemblyID] = @StartProductID 
            AND @CheckDate >= b.[StartDate] 
            AND @CheckDate <= ISNULL(b.[EndDate], @CheckDate)
        UNION ALL
        SELECT b.[ProductAssemblyID], b.[ComponentID], p.[Name], b.[PerAssemblyQty], p.[StandardCost], p.[ListPrice], b.[BOMLevel], [RecursionLevel] + 1 -- Join recursive member to anchor
        FROM [BOM_cte] cte
            INNER JOIN [Production].[BillOfMaterials] b 
            ON b.[ProductAssemblyID] = cte.[ComponentID]
            INNER JOIN [Production].[Product] p 
            ON b.[ComponentID] = p.[ProductID] 
        WHERE @CheckDate >= b.[StartDate] 
            AND @CheckDate <= ISNULL(b.[EndDate], @CheckDate)
        )
    -- Outer select from the CTE
    SELECT b.[ProductAssemblyID], b.[ComponentID], b.[ComponentDesc], SUM(b.[PerAssemblyQty]) AS [TotalQuantity] , b.[StandardCost], b.[ListPrice], b.[BOMLevel], b.[RecursionLevel]
    FROM [BOM_cte] b
    GROUP BY b.[ComponentID], b.[ComponentDesc], b.[ProductAssemblyID], b.[BOMLevel], b.[RecursionLevel], b.[StandardCost], b.[ListPrice]
    ORDER BY b.[BOMLevel], b.[ProductAssemblyID], b.[ComponentID]
    OPTION (MAXRECURSION 25) 
END;
Dependent Objects
Dependent ObjDependent Obj Type
BillOfMaterialsUSER_TABLE
ProductUSER_TABLE
uspGetEmployeeManagers
Definition
Routine Definition

CREATE PROCEDURE [dbo].[uspGetEmployeeManagers]
    @EmployeeID [int]
AS
BEGIN
    SET NOCOUNT ON;

    -- Use recursive query to list out all Employees required for a particular Manager
    WITH [EMP_cte]([EmployeeID], [ManagerID], [FirstName], [LastName], [Title], [RecursionLevel]) -- CTE name and columns
    AS (
        SELECT e.[EmployeeID], e.[ManagerID], c.[FirstName], c.[LastName], e.[Title], 0 -- Get the initial Employee
        FROM [HumanResources].[Employee] e 
            INNER JOIN [Person].[Contact] c 
            ON e.[ContactID] = c.[ContactID]
        WHERE e.[EmployeeID] = @EmployeeID
        UNION ALL
        SELECT e.[EmployeeID], e.[ManagerID], c.[FirstName], c.[LastName], e.[Title], [RecursionLevel] + 1 -- Join recursive member to anchor
        FROM [HumanResources].[Employee] e 
            INNER JOIN [EMP_cte]
            ON e.[EmployeeID] = [EMP_cte].[ManagerID]
            INNER JOIN [Person].[Contact] c 
            ON e.[ContactID] = c.[ContactID]
    )
    -- Join back to Employee to return the manager name 
    SELECT [EMP_cte].[RecursionLevel], [EMP_cte].[EmployeeID], [EMP_cte].[FirstName], [EMP_cte].[LastName], 
        [EMP_cte].[ManagerID], c.[FirstName] AS 'ManagerFirstName', c.[LastName] AS 'ManagerLastName'  -- Outer select from the CTE
    FROM [EMP_cte] 
        INNER JOIN [HumanResources].[Employee] e 
        ON [EMP_cte].[ManagerID] = e.[EmployeeID]
        INNER JOIN [Person].[Contact] c 
        ON e.[ContactID] = c.[ContactID]
    ORDER BY [RecursionLevel], [ManagerID], [EmployeeID]
    OPTION (MAXRECURSION 25) 
END;
Dependent Objects
Dependent ObjDependent Obj Type
ContactUSER_TABLE
EmployeeUSER_TABLE
uspGetManagerEmployees
Definition
Routine Definition

CREATE PROCEDURE [dbo].[uspGetManagerEmployees]
    @ManagerID [int]
AS
BEGIN
    SET NOCOUNT ON;

    -- Use recursive query to list out all Employees required for a particular Manager
    WITH [EMP_cte]([EmployeeID], [ManagerID], [FirstName], [LastName], [RecursionLevel]) -- CTE name and columns
    AS (
        SELECT e.[EmployeeID], e.[ManagerID], c.[FirstName], c.[LastName], 0 -- Get the initial list of Employees for Manager n
        FROM [HumanResources].[Employee] e 
            INNER JOIN [Person].[Contact] c 
            ON e.[ContactID] = c.[ContactID]
        WHERE [ManagerID] = @ManagerID
        UNION ALL
        SELECT e.[EmployeeID], e.[ManagerID], c.[FirstName], c.[LastName], [RecursionLevel] + 1 -- Join recursive member to anchor
        FROM [HumanResources].[Employee] e 
            INNER JOIN [EMP_cte]
            ON e.[ManagerID] = [EMP_cte].[EmployeeID]
            INNER JOIN [Person].[Contact] c 
            ON e.[ContactID] = c.[ContactID]
        )
    -- Join back to Employee to return the manager name 
    SELECT [EMP_cte].[RecursionLevel], [EMP_cte].[ManagerID], c.[FirstName] AS 'ManagerFirstName', c.[LastName] AS 'ManagerLastName',
        [EMP_cte].[EmployeeID], [EMP_cte].[FirstName], [EMP_cte].[LastName] -- Outer select from the CTE
    FROM [EMP_cte] 
        INNER JOIN [HumanResources].[Employee] e 
        ON [EMP_cte].[ManagerID] = e.[EmployeeID]
        INNER JOIN [Person].[Contact] c 
        ON e.[ContactID] = c.[ContactID]
    ORDER BY [RecursionLevel], [ManagerID], [EmployeeID]
    OPTION (MAXRECURSION 25) 
END;
Dependent Objects
Dependent ObjDependent Obj Type
ContactUSER_TABLE
EmployeeUSER_TABLE
uspGetWhereUsedProductID
Definition
Routine Definition

CREATE PROCEDURE [dbo].[uspGetWhereUsedProductID]
    @StartProductID [int],
    @CheckDate [datetime]
AS
BEGIN
    SET NOCOUNT ON;

    --Use recursive query to generate a multi-level Bill of Material (i.e. all level 1 components of a level 0 assembly, all level 2 components of a level 1 assembly)
    WITH [BOM_cte]([ProductAssemblyID], [ComponentID], [ComponentDesc], [PerAssemblyQty], [StandardCost], [ListPrice], [BOMLevel], [RecursionLevel]) -- CTE name and columns
    AS (
        SELECT b.[ProductAssemblyID], b.[ComponentID], p.[Name], b.[PerAssemblyQty], p.[StandardCost], p.[ListPrice], b.[BOMLevel], 0 -- Get the initial list of components for the bike assembly
        FROM [Production].[BillOfMaterials] b
            INNER JOIN [Production].[Product] p 
            ON b.[ProductAssemblyID] = p.[ProductID] 
        WHERE b.[ComponentID] = @StartProductID 
            AND @CheckDate >= b.[StartDate] 
            AND @CheckDate <= ISNULL(b.[EndDate], @CheckDate)
        UNION ALL
        SELECT b.[ProductAssemblyID], b.[ComponentID], p.[Name], b.[PerAssemblyQty], p.[StandardCost], p.[ListPrice], b.[BOMLevel], [RecursionLevel] + 1 -- Join recursive member to anchor
        FROM [BOM_cte] cte
            INNER JOIN [Production].[BillOfMaterials] b 
            ON cte.[ProductAssemblyID] = b.[ComponentID]
            INNER JOIN [Production].[Product] p 
            ON b.[ProductAssemblyID] = p.[ProductID] 
        WHERE @CheckDate >= b.[StartDate] 
            AND @CheckDate <= ISNULL(b.[EndDate], @CheckDate)
        )
    -- Outer select from the CTE
    SELECT b.[ProductAssemblyID], b.[ComponentID], b.[ComponentDesc], SUM(b.[PerAssemblyQty]) AS [TotalQuantity] , b.[StandardCost], b.[ListPrice], b.[BOMLevel], b.[RecursionLevel]
    FROM [BOM_cte] b
    GROUP BY b.[ComponentID], b.[ComponentDesc], b.[ProductAssemblyID], b.[BOMLevel], b.[RecursionLevel], b.[StandardCost], b.[ListPrice]
    ORDER BY b.[BOMLevel], b.[ProductAssemblyID], b.[ComponentID]
    OPTION (MAXRECURSION 25) 
END;
Dependent Objects
Dependent ObjDependent Obj Type
BillOfMaterialsUSER_TABLE
ProductUSER_TABLE
uspUpdateEmployeeHireInfo
Definition
Routine Definition

CREATE PROCEDURE [HumanResources].[uspUpdateEmployeeHireInfo]
    @EmployeeID [int], 
    @Title [nvarchar](50), 
    @HireDate [datetime], 
    @RateChangeDate [datetime], 
    @Rate [money], 
    @PayFrequency [tinyint], 
    @CurrentFlag [dbo].[Flag] 
WITH EXECUTE AS CALLER
AS
BEGIN
    SET NOCOUNT ON;

    BEGIN TRY
        BEGIN TRANSACTION;

        UPDATE [HumanResources].[Employee] 
        SET [Title] = @Title 
            ,[HireDate] = @HireDate 
            ,[CurrentFlag] = @CurrentFlag 
        WHERE [EmployeeID] = @EmployeeID;

        INSERT INTO [HumanResources].[EmployeePayHistory] 
            ([EmployeeID]
            ,[RateChangeDate]
            ,[Rate]
            ,[PayFrequency]) 
        VALUES (@EmployeeID, @RateChangeDate, @Rate, @PayFrequency);

        COMMIT TRANSACTION;
    END TRY
    BEGIN CATCH
        -- Rollback any active or uncommittable transactions before
        -- inserting information in the ErrorLog
        IF @@TRANCOUNT > 0
        BEGIN
            ROLLBACK TRANSACTION;
        END

        EXECUTE [dbo].[uspLogError];
    END CATCH;
END;
Dependent Objects
Dependent ObjDependent Obj Type
uspLogErrorSQL_STORED_PROCEDURE
EmployeeUSER_TABLE
EmployeePayHistoryUSER_TABLE
uspUpdateEmployeeLogin
Definition
Routine Definition

CREATE PROCEDURE [HumanResources].[uspUpdateEmployeeLogin]
    @EmployeeID [int], 
    @ManagerID [int],
    @LoginID [nvarchar](256),
    @Title [nvarchar](50),
    @HireDate [datetime],
    @CurrentFlag [dbo].[Flag]
WITH EXECUTE AS CALLER
AS
BEGIN
    SET NOCOUNT ON;

    BEGIN TRY
        UPDATE [HumanResources].[Employee] 
        SET [ManagerID] = @ManagerID 
            ,[LoginID] = @LoginID 
            ,[Title] = @Title 
            ,[HireDate] = @HireDate 
            ,[CurrentFlag] = @CurrentFlag 
        WHERE [EmployeeID] = @EmployeeID;
    END TRY
    BEGIN CATCH
        EXECUTE [dbo].[uspLogError];
    END CATCH;
END;
Dependent Objects
Dependent ObjDependent Obj Type
uspLogErrorSQL_STORED_PROCEDURE
EmployeeUSER_TABLE
uspUpdateEmployeePersonalInfo
Definition
Routine Definition

CREATE PROCEDURE [HumanResources].[uspUpdateEmployeePersonalInfo]
    @EmployeeID [int], 
    @NationalIDNumber [nvarchar](15), 
    @BirthDate [datetime], 
    @MaritalStatus [nchar](1), 
    @Gender [nchar](1)
WITH EXECUTE AS CALLER
AS
BEGIN
    SET NOCOUNT ON;

    BEGIN TRY
        UPDATE [HumanResources].[Employee] 
        SET [NationalIDNumber] = @NationalIDNumber 
            ,[BirthDate] = @BirthDate 
            ,[MaritalStatus] = @MaritalStatus 
            ,[Gender] = @Gender 
        WHERE [EmployeeID] = @EmployeeID;
    END TRY
    BEGIN CATCH
        EXECUTE [dbo].[uspLogError];
    END CATCH;
END;
Dependent Objects
Dependent ObjDependent Obj Type
uspLogErrorSQL_STORED_PROCEDURE
EmployeeUSER_TABLE
Functions
Function NameFunction Schema
ufnLeadingZerosdbo
ufnGetAccountingStartDatedbo
ufnGetAccountingEndDatedbo
ufnGetContactInformationdbo
ufnGetProductDealerPricedbo
ufnGetProductListPricedbo
ufnGetProductStandardCostdbo
ufnGetStockdbo
ufnGetDocumentStatusTextdbo
ufnGetPurchaseOrderStatusTextdbo
ufnGetSalesOrderStatusTextdbo
ufnLeadingZeros
Definition
Routine Definition

CREATE FUNCTION [dbo].[ufnLeadingZeros](
    @Value int

RETURNS varchar(8) 
WITH SCHEMABINDING 
AS 
BEGIN
    DECLARE @ReturnValue varchar(8);

    SET @ReturnValue = CONVERT(varchar(8), @Value);
    SET @ReturnValue = REPLICATE('0', 8 - DATALENGTH(@ReturnValue)) + @ReturnValue;

    RETURN (@ReturnValue);
END;
Dependent Objects
Dependent ObjDependent Obj Type
CustomerUSER_TABLE
ufnGetAccountingStartDate
Definition
Routine Definition

CREATE FUNCTION [dbo].[ufnGetAccountingStartDate]()
RETURNS [datetime] 
AS 
BEGIN
    RETURN CONVERT(datetime, '20030701', 112);
END;
Dependent Objects
Dependent ObjDependent Obj Type
ufnGetAccountingEndDate
Definition
Routine Definition

CREATE FUNCTION [dbo].[ufnGetAccountingEndDate]()
RETURNS [datetime] 
AS 
BEGIN
    RETURN DATEADD(millisecond, -2, CONVERT(datetime, '20040701', 112));
END;
Dependent Objects
Dependent ObjDependent Obj Type
ufnGetContactInformation
Definition
Routine Definition

CREATE FUNCTION [dbo].[ufnGetContactInformation](@ContactID int)
RETURNS @retContactInformation TABLE 
(
    -- Columns returned by the function
    [ContactID] int PRIMARY KEY NOT NULL, 
    [FirstName] [nvarchar](50) NULL, 
    [LastName] [nvarchar](50) NULL, 
    [JobTitle] [nvarchar](50) NULL, 
    [ContactType] [nvarchar](50) NULL
)
AS 
-- Returns the first name, last name, job title and contact type for the specified contact.
BEGIN
    DECLARE 
        @FirstName [nvarchar](50), 
        @LastName [nvarchar](50), 
        @JobTitle [nvarchar](50), 
        @ContactType [nvarchar](50);
    -- Get common contact information
    SELECT 
        @ContactID = ContactID, 
        @FirstName = FirstName, 
        @LastName = LastName
    FROM [Person].[Contact] 
    WHERE [ContactID] = @ContactID;

    SET @JobTitle = 
        CASE 
            -- Check for employee
            WHEN EXISTS(SELECT * FROM [HumanResources].[Employee] e 
                WHERE e.[ContactID] = @ContactID) 
                THEN (SELECT [Title] 
                    FROM [HumanResources].[Employee] 
                    WHERE [ContactID] = @ContactID)

            -- Check for vendor
            WHEN EXISTS(SELECT * FROM [Purchasing].[VendorContact] vc 
                    INNER JOIN [Person].[ContactType] ct 
                    ON vc.[ContactTypeID] = ct.[ContactTypeID] 
                WHERE vc.[ContactID] = @ContactID) 
                THEN (SELECT ct.[Name] 
                    FROM [Purchasing].[VendorContact] vc 
                        INNER JOIN [Person].[ContactType] ct 
                        ON vc.[ContactTypeID] = ct.[ContactTypeID] 
                    WHERE vc.[ContactID] = @ContactID)

            -- Check for store
            WHEN EXISTS(SELECT * FROM [Sales].[StoreContact] sc 
                    INNER JOIN [Person].[ContactType] ct 
                    ON sc.[ContactTypeID] = ct.[ContactTypeID] 
                WHERE sc.[ContactID] = @ContactID) 
                THEN (SELECT ct.[Name] 
                    FROM [Sales].[StoreContact] sc 
                        INNER JOIN [Person].[ContactType] ct 
                        ON sc.[ContactTypeID] = ct.[ContactTypeID] 
                    WHERE [ContactID] = @ContactID)

            ELSE NULL 
        END;

    SET @ContactType = 
        CASE 
            -- Check for employee
            WHEN EXISTS(SELECT * FROM [HumanResources].[Employee] e 
                WHERE e.[ContactID] = @ContactID) 
                THEN 'Employee'

            -- Check for vendor
            WHEN EXISTS(SELECT * FROM [Purchasing].[VendorContact] vc 
                    INNER JOIN [Person].[ContactType] ct 
                    ON vc.[ContactTypeID] = ct.[ContactTypeID] 
                WHERE vc.[ContactID] = @ContactID) 
                THEN 'Vendor Contact'

            -- Check for store
            WHEN EXISTS(SELECT * FROM [Sales].[StoreContact] sc 
                    INNER JOIN [Person].[ContactType] ct 
                    ON sc.[ContactTypeID] = ct.[ContactTypeID] 
                WHERE sc.[ContactID] = @ContactID) 
                THEN 'Store Contact'

            -- Check for individual consumer
            WHEN EXISTS(SELECT * FROM [Sales].[Individual] i 
                WHERE i.[ContactID] = @ContactID) 
                THEN 'Consumer'
        END;

    -- Return the information to the caller
    IF @ContactID IS NOT NULL 
    BEGIN
        INSERT @retContactInformation
        SELECT @ContactID, @FirstName, @LastName, @JobTitle, @ContactType;
    END;

    RETURN;
END;
Dependent Objects
Dependent ObjDependent Obj Type
ContactUSER_TABLE
ContactTypeUSER_TABLE
EmployeeUSER_TABLE
IndividualUSER_TABLE
StoreContactUSER_TABLE
VendorContactUSER_TABLE
ufnGetProductDealerPrice
Definition
Routine Definition

CREATE FUNCTION [dbo].[ufnGetProductDealerPrice](@ProductID [int], @OrderDate [datetime])
RETURNS [money] 
AS 
-- Returns the dealer price for the product on a specific date.
BEGIN
    DECLARE @DealerPrice money;
    DECLARE @DealerDiscount money;

    SET @DealerDiscount = 0.60  -- 60% of list price

    SELECT @DealerPrice = plph.[ListPrice] * @DealerDiscount 
    FROM [Production].[Product] p 
        INNER JOIN [Production].[ProductListPriceHistory] plph 
        ON p.[ProductID] = plph.[ProductID] 
            AND p.[ProductID] = @ProductID 
            AND @OrderDate BETWEEN plph.[StartDate] AND COALESCE(plph.[EndDate], CONVERT(datetime, '99991231', 112)); -- Make sure we get all the prices!

    RETURN @DealerPrice;
END;
Dependent Objects
Dependent ObjDependent Obj Type
ProductUSER_TABLE
ProductListPriceHistoryUSER_TABLE
ufnGetProductListPrice
Definition
Routine Definition

CREATE FUNCTION [dbo].[ufnGetProductListPrice](@ProductID [int], @OrderDate [datetime])
RETURNS [money] 
AS 
BEGIN
    DECLARE @ListPrice money;

    SELECT @ListPrice = plph.[ListPrice] 
    FROM [Production].[Product] p 
        INNER JOIN [Production].[ProductListPriceHistory] plph 
        ON p.[ProductID] = plph.[ProductID] 
            AND p.[ProductID] = @ProductID 
            AND @OrderDate BETWEEN plph.[StartDate] AND COALESCE(plph.[EndDate], CONVERT(datetime, '99991231', 112)); -- Make sure we get all the prices!

    RETURN @ListPrice;
END;
Dependent Objects
Dependent ObjDependent Obj Type
ProductUSER_TABLE
ProductListPriceHistoryUSER_TABLE
ufnGetProductStandardCost
Definition
Routine Definition

CREATE FUNCTION [dbo].[ufnGetProductStandardCost](@ProductID [int], @OrderDate [datetime])
RETURNS [money] 
AS 
-- Returns the standard cost for the product on a specific date.
BEGIN
    DECLARE @StandardCost money;

    SELECT @StandardCost = pch.[StandardCost] 
    FROM [Production].[Product] p 
        INNER JOIN [Production].[ProductCostHistory] pch 
        ON p.[ProductID] = pch.[ProductID] 
            AND p.[ProductID] = @ProductID 
            AND @OrderDate BETWEEN pch.[StartDate] AND COALESCE(pch.[EndDate], CONVERT(datetime, '99991231', 112)); -- Make sure we get all the prices!

    RETURN @StandardCost;
END;
Dependent Objects
Dependent ObjDependent Obj Type
ProductUSER_TABLE
ProductCostHistoryUSER_TABLE
ufnGetStock
Definition
Routine Definition

CREATE FUNCTION [dbo].[ufnGetStock](@ProductID [int])
RETURNS [int] 
AS 
-- Returns the stock level for the product. This function is used internally only
BEGIN
    DECLARE @ret int;
    
    SELECT @ret = SUM(p.[Quantity]) 
    FROM [Production].[ProductInventory] p 
    WHERE p.[ProductID] = @ProductID 
        AND p.[LocationID] = '6'; -- Only look at inventory in the misc storage
    
    IF (@ret IS NULL) 
        SET @ret = 0
    
    RETURN @ret
END;
Dependent Objects
Dependent ObjDependent Obj Type
ProductInventoryUSER_TABLE
ufnGetDocumentStatusText
Definition
Routine Definition

CREATE FUNCTION [dbo].[ufnGetDocumentStatusText](@Status [tinyint])
RETURNS [nvarchar](16) 
AS 
-- Returns the sales order status text representation for the status value.
BEGIN
    DECLARE @ret [nvarchar](16);

    SET @ret = 
        CASE @Status
            WHEN 1 THEN N'Pending approval'
            WHEN 2 THEN N'Approved'
            WHEN 3 THEN N'Obsolete'
            ELSE N'** Invalid **'
        END;
    
    RETURN @ret
END;
Dependent Objects
Dependent ObjDependent Obj Type
ufnGetPurchaseOrderStatusText
Definition
Routine Definition

CREATE FUNCTION [dbo].[ufnGetPurchaseOrderStatusText](@Status [tinyint])
RETURNS [nvarchar](15) 
AS 
-- Returns the sales order status text representation for the status value.
BEGIN
    DECLARE @ret [nvarchar](15);

    SET @ret = 
        CASE @Status
            WHEN 1 THEN 'Pending'
            WHEN 2 THEN 'Approved'
            WHEN 3 THEN 'Rejected'
            WHEN 4 THEN 'Complete'
            ELSE '** Invalid **'
        END;
    
    RETURN @ret
END;
Dependent Objects
Dependent ObjDependent Obj Type
ufnGetSalesOrderStatusText
Definition
Routine Definition

CREATE FUNCTION [dbo].[ufnGetSalesOrderStatusText](@Status [tinyint])
RETURNS [nvarchar](15) 
AS 
-- Returns the sales order status text representation for the status value.
BEGIN
    DECLARE @ret [nvarchar](15);

    SET @ret = 
        CASE @Status
            WHEN 1 THEN 'In process'
            WHEN 2 THEN 'Approved'
            WHEN 3 THEN 'Backordered'
            WHEN 4 THEN 'Rejected'
            WHEN 5 THEN 'Shipped'
            WHEN 6 THEN 'Cancelled'
            ELSE '** Invalid **'
        END;
    
    RETURN @ret
END;
Dependent Objects
Dependent ObjDependent Obj Type
Indexes
Table NameIndex NameColumn NameIndex TypeIs UniqueIs Primary KeyIs Unique ConstraintIs DisabledIs PaddedIs Hypothetical
AddressAK_Address_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
AddressIX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCodeAddressLine1NONCLUSTEREDtruefalsefalsefalsefalsefalse
AddressIX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCodeAddressLine2NONCLUSTEREDtruefalsefalsefalsefalsefalse
AddressIX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCodeCityNONCLUSTEREDtruefalsefalsefalsefalsefalse
AddressIX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCodeStateProvinceIDNONCLUSTEREDtruefalsefalsefalsefalsefalse
AddressIX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCodePostalCodeNONCLUSTEREDtruefalsefalsefalsefalsefalse
AddressIX_Address_StateProvinceIDStateProvinceIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
AddressPK_Address_AddressIDAddressIDCLUSTEREDtruetruefalsefalsefalsefalse
AddressTypeAK_AddressType_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
AddressTypeAK_AddressType_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
AddressTypePK_AddressType_AddressTypeIDAddressTypeIDCLUSTEREDtruetruefalsefalsefalsefalse
AWBuildVersionPK_AWBuildVersion_SystemInformationIDSystemInformationIDCLUSTEREDtruetruefalsefalsefalsefalse
BillOfMaterialsAK_BillOfMaterials_ProductAssemblyID_ComponentID_StartDateProductAssemblyIDCLUSTEREDtruefalsefalsefalsefalsefalse
BillOfMaterialsAK_BillOfMaterials_ProductAssemblyID_ComponentID_StartDateComponentIDCLUSTEREDtruefalsefalsefalsefalsefalse
BillOfMaterialsAK_BillOfMaterials_ProductAssemblyID_ComponentID_StartDateStartDateCLUSTEREDtruefalsefalsefalsefalsefalse
BillOfMaterialsIX_BillOfMaterials_UnitMeasureCodeUnitMeasureCodeNONCLUSTEREDfalsefalsefalsefalsefalsefalse
BillOfMaterialsPK_BillOfMaterials_BillOfMaterialsIDBillOfMaterialsIDNONCLUSTEREDtruetruefalsefalsefalsefalse
ContactAK_Contact_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
ContactIX_Contact_EmailAddressEmailAddressNONCLUSTEREDfalsefalsefalsefalsefalsefalse
ContactPK_Contact_ContactIDContactIDCLUSTEREDtruetruefalsefalsefalsefalse
ContactPXML_Contact_AddContactAdditionalContactInfoXMLfalsefalsefalsefalsefalsefalse
ContactCreditCardPK_ContactCreditCard_ContactID_CreditCardIDContactIDCLUSTEREDtruetruefalsefalsefalsefalse
ContactCreditCardPK_ContactCreditCard_ContactID_CreditCardIDCreditCardIDCLUSTEREDtruetruefalsefalsefalsefalse
ContactTypeAK_ContactType_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
ContactTypePK_ContactType_ContactTypeIDContactTypeIDCLUSTEREDtruetruefalsefalsefalsefalse
CountryRegionAK_CountryRegion_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
CountryRegionPK_CountryRegion_CountryRegionCodeCountryRegionCodeCLUSTEREDtruetruefalsefalsefalsefalse
CountryRegionCurrencyIX_CountryRegionCurrency_CurrencyCodeCurrencyCodeNONCLUSTEREDfalsefalsefalsefalsefalsefalse
CountryRegionCurrencyPK_CountryRegionCurrency_CountryRegionCode_CurrencyCodeCountryRegionCodeCLUSTEREDtruetruefalsefalsefalsefalse
CountryRegionCurrencyPK_CountryRegionCurrency_CountryRegionCode_CurrencyCodeCurrencyCodeCLUSTEREDtruetruefalsefalsefalsefalse
CreditCardAK_CreditCard_CardNumberCardNumberNONCLUSTEREDtruefalsefalsefalsefalsefalse
CreditCardPK_CreditCard_CreditCardIDCreditCardIDCLUSTEREDtruetruefalsefalsefalsefalse
CultureAK_Culture_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
CulturePK_Culture_CultureIDCultureIDCLUSTEREDtruetruefalsefalsefalsefalse
CurrencyAK_Currency_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
CurrencyPK_Currency_CurrencyCodeCurrencyCodeCLUSTEREDtruetruefalsefalsefalsefalse
CurrencyRateAK_CurrencyRate_CurrencyRateDate_FromCurrencyCode_ToCurrencyCodeCurrencyRateDateNONCLUSTEREDtruefalsefalsefalsefalsefalse
CurrencyRateAK_CurrencyRate_CurrencyRateDate_FromCurrencyCode_ToCurrencyCodeFromCurrencyCodeNONCLUSTEREDtruefalsefalsefalsefalsefalse
CurrencyRateAK_CurrencyRate_CurrencyRateDate_FromCurrencyCode_ToCurrencyCodeToCurrencyCodeNONCLUSTEREDtruefalsefalsefalsefalsefalse
CurrencyRatePK_CurrencyRate_CurrencyRateIDCurrencyRateIDCLUSTEREDtruetruefalsefalsefalsefalse
CustomerAK_Customer_AccountNumberAccountNumberNONCLUSTEREDtruefalsefalsefalsefalsefalse
CustomerAK_Customer_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
CustomerIX_Customer_TerritoryIDTerritoryIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
CustomerPK_Customer_CustomerIDCustomerIDCLUSTEREDtruetruefalsefalsefalsefalse
CustomerAddressAK_CustomerAddress_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
CustomerAddressPK_CustomerAddress_CustomerID_AddressIDCustomerIDCLUSTEREDtruetruefalsefalsefalsefalse
CustomerAddressPK_CustomerAddress_CustomerID_AddressIDAddressIDCLUSTEREDtruetruefalsefalsefalsefalse
DatabaseLogPK_DatabaseLog_DatabaseLogIDDatabaseLogIDNONCLUSTEREDtruetruefalsefalsefalsefalse
DepartmentAK_Department_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
DepartmentPK_Department_DepartmentIDDepartmentIDCLUSTEREDtruetruefalsefalsefalsefalse
DocumentAK_Document_FileName_RevisionFileNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
DocumentAK_Document_FileName_RevisionRevisionNONCLUSTEREDtruefalsefalsefalsefalsefalse
DocumentPK_Document_DocumentIDDocumentIDCLUSTEREDtruetruefalsefalsefalsefalse
EmployeeAK_Employee_LoginIDLoginIDNONCLUSTEREDtruefalsefalsefalsefalsefalse
EmployeeAK_Employee_NationalIDNumberNationalIDNumberNONCLUSTEREDtruefalsefalsefalsefalsefalse
EmployeeAK_Employee_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
EmployeeIX_Employee_ManagerIDManagerIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
EmployeePK_Employee_EmployeeIDEmployeeIDCLUSTEREDtruetruefalsefalsefalsefalse
EmployeeAddressAK_EmployeeAddress_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
EmployeeAddressPK_EmployeeAddress_EmployeeID_AddressIDEmployeeIDCLUSTEREDtruetruefalsefalsefalsefalse
EmployeeAddressPK_EmployeeAddress_EmployeeID_AddressIDAddressIDCLUSTEREDtruetruefalsefalsefalsefalse
EmployeeDepartmentHistoryIX_EmployeeDepartmentHistory_DepartmentIDDepartmentIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
EmployeeDepartmentHistoryIX_EmployeeDepartmentHistory_ShiftIDShiftIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
EmployeeDepartmentHistoryPK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentIDEmployeeIDCLUSTEREDtruetruefalsefalsefalsefalse
EmployeeDepartmentHistoryPK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentIDDepartmentIDCLUSTEREDtruetruefalsefalsefalsefalse
EmployeeDepartmentHistoryPK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentIDShiftIDCLUSTEREDtruetruefalsefalsefalsefalse
EmployeeDepartmentHistoryPK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentIDStartDateCLUSTEREDtruetruefalsefalsefalsefalse
EmployeePayHistoryPK_EmployeePayHistory_EmployeeID_RateChangeDateEmployeeIDCLUSTEREDtruetruefalsefalsefalsefalse
EmployeePayHistoryPK_EmployeePayHistory_EmployeeID_RateChangeDateRateChangeDateCLUSTEREDtruetruefalsefalsefalsefalse
ErrorLogPK_ErrorLog_ErrorLogIDErrorLogIDCLUSTEREDtruetruefalsefalsefalsefalse
IllustrationPK_Illustration_IllustrationIDIllustrationIDCLUSTEREDtruetruefalsefalsefalsefalse
IndividualPK_Individual_CustomerIDCustomerIDCLUSTEREDtruetruefalsefalsefalsefalse
IndividualPXML_Individual_DemographicsDemographicsXMLfalsefalsefalsefalsefalsefalse
IndividualXMLPATH_Individual_DemographicsDemographicsXMLfalsefalsefalsefalsefalsefalse
IndividualXMLPROPERTY_Individual_DemographicsDemographicsXMLfalsefalsefalsefalsefalsefalse
IndividualXMLVALUE_Individual_DemographicsDemographicsXMLfalsefalsefalsefalsefalsefalse
JobCandidateIX_JobCandidate_EmployeeIDEmployeeIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
JobCandidatePK_JobCandidate_JobCandidateIDJobCandidateIDCLUSTEREDtruetruefalsefalsefalsefalse
LocationAK_Location_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
LocationPK_Location_LocationIDLocationIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductAK_Product_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
ProductAK_Product_ProductNumberProductNumberNONCLUSTEREDtruefalsefalsefalsefalsefalse
ProductAK_Product_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
ProductPK_Product_ProductIDProductIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductCategoryAK_ProductCategory_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
ProductCategoryAK_ProductCategory_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
ProductCategoryPK_ProductCategory_ProductCategoryIDProductCategoryIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductCostHistoryPK_ProductCostHistory_ProductID_StartDateProductIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductCostHistoryPK_ProductCostHistory_ProductID_StartDateStartDateCLUSTEREDtruetruefalsefalsefalsefalse
ProductDescriptionAK_ProductDescription_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
ProductDescriptionPK_ProductDescription_ProductDescriptionIDProductDescriptionIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductDocumentPK_ProductDocument_ProductID_DocumentIDProductIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductDocumentPK_ProductDocument_ProductID_DocumentIDDocumentIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductInventoryPK_ProductInventory_ProductID_LocationIDProductIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductInventoryPK_ProductInventory_ProductID_LocationIDLocationIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductListPriceHistoryPK_ProductListPriceHistory_ProductID_StartDateProductIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductListPriceHistoryPK_ProductListPriceHistory_ProductID_StartDateStartDateCLUSTEREDtruetruefalsefalsefalsefalse
ProductModelAK_ProductModel_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
ProductModelAK_ProductModel_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
ProductModelPK_ProductModel_ProductModelIDProductModelIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductModelPXML_ProductModel_CatalogDescriptionCatalogDescriptionXMLfalsefalsefalsefalsefalsefalse
ProductModelPXML_ProductModel_InstructionsInstructionsXMLfalsefalsefalsefalsefalsefalse
ProductModelIllustrationPK_ProductModelIllustration_ProductModelID_IllustrationIDProductModelIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductModelIllustrationPK_ProductModelIllustration_ProductModelID_IllustrationIDIllustrationIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductModelProductDescriptionCulturePK_ProductModelProductDescriptionCulture_ProductModelID_ProductDescriptionID_CultureIDProductModelIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductModelProductDescriptionCulturePK_ProductModelProductDescriptionCulture_ProductModelID_ProductDescriptionID_CultureIDProductDescriptionIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductModelProductDescriptionCulturePK_ProductModelProductDescriptionCulture_ProductModelID_ProductDescriptionID_CultureIDCultureIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductPhotoPK_ProductPhoto_ProductPhotoIDProductPhotoIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductProductPhotoPK_ProductProductPhoto_ProductID_ProductPhotoIDProductIDNONCLUSTEREDtruetruefalsefalsefalsefalse
ProductProductPhotoPK_ProductProductPhoto_ProductID_ProductPhotoIDProductPhotoIDNONCLUSTEREDtruetruefalsefalsefalsefalse
ProductReviewIX_ProductReview_ProductID_NameProductIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
ProductReviewIX_ProductReview_ProductID_NameReviewerNameNONCLUSTEREDfalsefalsefalsefalsefalsefalse
ProductReviewIX_ProductReview_ProductID_NameCommentsNONCLUSTEREDfalsefalsefalsefalsefalsefalse
ProductReviewPK_ProductReview_ProductReviewIDProductReviewIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductSubcategoryAK_ProductSubcategory_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
ProductSubcategoryAK_ProductSubcategory_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
ProductSubcategoryPK_ProductSubcategory_ProductSubcategoryIDProductSubcategoryIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductVendorIX_ProductVendor_UnitMeasureCodeUnitMeasureCodeNONCLUSTEREDfalsefalsefalsefalsefalsefalse
ProductVendorIX_ProductVendor_VendorIDVendorIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
ProductVendorPK_ProductVendor_ProductID_VendorIDProductIDCLUSTEREDtruetruefalsefalsefalsefalse
ProductVendorPK_ProductVendor_ProductID_VendorIDVendorIDCLUSTEREDtruetruefalsefalsefalsefalse
PurchaseOrderDetailIX_PurchaseOrderDetail_ProductIDProductIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
PurchaseOrderDetailPK_PurchaseOrderDetail_PurchaseOrderID_PurchaseOrderDetailIDPurchaseOrderIDCLUSTEREDtruetruefalsefalsefalsefalse
PurchaseOrderDetailPK_PurchaseOrderDetail_PurchaseOrderID_PurchaseOrderDetailIDPurchaseOrderDetailIDCLUSTEREDtruetruefalsefalsefalsefalse
PurchaseOrderHeaderIX_PurchaseOrderHeader_EmployeeIDEmployeeIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
PurchaseOrderHeaderIX_PurchaseOrderHeader_VendorIDVendorIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
PurchaseOrderHeaderPK_PurchaseOrderHeader_PurchaseOrderIDPurchaseOrderIDCLUSTEREDtruetruefalsefalsefalsefalse
queue_messages_1977058079queue_clustered_indexstatusCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_1977058079queue_clustered_indexqueuing_orderCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_1977058079queue_clustered_indexconversation_group_idCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_1977058079queue_clustered_indexconversation_handleCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_1977058079queue_secondary_indexstatusNONCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_1977058079queue_secondary_indexpriorityNONCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_1977058079queue_secondary_indexqueuing_orderNONCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_1977058079queue_secondary_indexconversation_group_idNONCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_1977058079queue_secondary_indexconversation_handleNONCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_1977058079queue_secondary_indexservice_idNONCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_2009058193queue_clustered_indexstatusCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_2009058193queue_clustered_indexqueuing_orderCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_2009058193queue_clustered_indexconversation_group_idCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_2009058193queue_clustered_indexconversation_handleCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_2009058193queue_secondary_indexstatusNONCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_2009058193queue_secondary_indexpriorityNONCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_2009058193queue_secondary_indexqueuing_orderNONCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_2009058193queue_secondary_indexconversation_group_idNONCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_2009058193queue_secondary_indexconversation_handleNONCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_2009058193queue_secondary_indexservice_idNONCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_2041058307queue_clustered_indexstatusCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_2041058307queue_clustered_indexqueuing_orderCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_2041058307queue_clustered_indexconversation_group_idCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_2041058307queue_clustered_indexconversation_handleCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_2041058307queue_secondary_indexstatusNONCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_2041058307queue_secondary_indexpriorityNONCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_2041058307queue_secondary_indexqueuing_orderNONCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_2041058307queue_secondary_indexconversation_group_idNONCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_2041058307queue_secondary_indexconversation_handleNONCLUSTEREDtruefalsefalsefalsefalsefalse
queue_messages_2041058307queue_secondary_indexservice_idNONCLUSTEREDtruefalsefalsefalsefalsefalse
SalesOrderDetailAK_SalesOrderDetail_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
SalesOrderDetailIX_SalesOrderDetail_ProductIDProductIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
SalesOrderDetailPK_SalesOrderDetail_SalesOrderID_SalesOrderDetailIDSalesOrderIDCLUSTEREDtruetruefalsefalsefalsefalse
SalesOrderDetailPK_SalesOrderDetail_SalesOrderID_SalesOrderDetailIDSalesOrderDetailIDCLUSTEREDtruetruefalsefalsefalsefalse
SalesOrderHeaderAK_SalesOrderHeader_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
SalesOrderHeaderAK_SalesOrderHeader_SalesOrderNumberSalesOrderNumberNONCLUSTEREDtruefalsefalsefalsefalsefalse
SalesOrderHeaderIX_SalesOrderHeader_CustomerIDCustomerIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
SalesOrderHeaderIX_SalesOrderHeader_SalesPersonIDSalesPersonIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
SalesOrderHeaderPK_SalesOrderHeader_SalesOrderIDSalesOrderIDCLUSTEREDtruetruefalsefalsefalsefalse
SalesOrderHeaderSalesReasonPK_SalesOrderHeaderSalesReason_SalesOrderID_SalesReasonIDSalesOrderIDCLUSTEREDtruetruefalsefalsefalsefalse
SalesOrderHeaderSalesReasonPK_SalesOrderHeaderSalesReason_SalesOrderID_SalesReasonIDSalesReasonIDCLUSTEREDtruetruefalsefalsefalsefalse
SalesPersonAK_SalesPerson_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
SalesPersonPK_SalesPerson_SalesPersonIDSalesPersonIDCLUSTEREDtruetruefalsefalsefalsefalse
SalesPersonQuotaHistoryAK_SalesPersonQuotaHistory_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
SalesPersonQuotaHistoryPK_SalesPersonQuotaHistory_SalesPersonID_QuotaDateSalesPersonIDCLUSTEREDtruetruefalsefalsefalsefalse
SalesPersonQuotaHistoryPK_SalesPersonQuotaHistory_SalesPersonID_QuotaDateQuotaDateCLUSTEREDtruetruefalsefalsefalsefalse
SalesReasonPK_SalesReason_SalesReasonIDSalesReasonIDCLUSTEREDtruetruefalsefalsefalsefalse
SalesTaxRateAK_SalesTaxRate_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
SalesTaxRateAK_SalesTaxRate_StateProvinceID_TaxTypeStateProvinceIDNONCLUSTEREDtruefalsefalsefalsefalsefalse
SalesTaxRateAK_SalesTaxRate_StateProvinceID_TaxTypeTaxTypeNONCLUSTEREDtruefalsefalsefalsefalsefalse
SalesTaxRatePK_SalesTaxRate_SalesTaxRateIDSalesTaxRateIDCLUSTEREDtruetruefalsefalsefalsefalse
SalesTerritoryAK_SalesTerritory_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
SalesTerritoryAK_SalesTerritory_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
SalesTerritoryPK_SalesTerritory_TerritoryIDTerritoryIDCLUSTEREDtruetruefalsefalsefalsefalse
SalesTerritoryHistoryAK_SalesTerritoryHistory_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
SalesTerritoryHistoryPK_SalesTerritoryHistory_SalesPersonID_StartDate_TerritoryIDSalesPersonIDCLUSTEREDtruetruefalsefalsefalsefalse
SalesTerritoryHistoryPK_SalesTerritoryHistory_SalesPersonID_StartDate_TerritoryIDTerritoryIDCLUSTEREDtruetruefalsefalsefalsefalse
SalesTerritoryHistoryPK_SalesTerritoryHistory_SalesPersonID_StartDate_TerritoryIDStartDateCLUSTEREDtruetruefalsefalsefalsefalse
ScrapReasonAK_ScrapReason_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
ScrapReasonPK_ScrapReason_ScrapReasonIDScrapReasonIDCLUSTEREDtruetruefalsefalsefalsefalse
ShiftAK_Shift_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
ShiftAK_Shift_StartTime_EndTimeStartTimeNONCLUSTEREDtruefalsefalsefalsefalsefalse
ShiftAK_Shift_StartTime_EndTimeEndTimeNONCLUSTEREDtruefalsefalsefalsefalsefalse
ShiftPK_Shift_ShiftIDShiftIDCLUSTEREDtruetruefalsefalsefalsefalse
ShipMethodAK_ShipMethod_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
ShipMethodAK_ShipMethod_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
ShipMethodPK_ShipMethod_ShipMethodIDShipMethodIDCLUSTEREDtruetruefalsefalsefalsefalse
ShoppingCartItemIX_ShoppingCartItem_ShoppingCartID_ProductIDShoppingCartIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
ShoppingCartItemIX_ShoppingCartItem_ShoppingCartID_ProductIDProductIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
ShoppingCartItemPK_ShoppingCartItem_ShoppingCartItemIDShoppingCartItemIDCLUSTEREDtruetruefalsefalsefalsefalse
SpecialOfferAK_SpecialOffer_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
SpecialOfferPK_SpecialOffer_SpecialOfferIDSpecialOfferIDCLUSTEREDtruetruefalsefalsefalsefalse
SpecialOfferProductAK_SpecialOfferProduct_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
SpecialOfferProductIX_SpecialOfferProduct_ProductIDProductIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
SpecialOfferProductPK_SpecialOfferProduct_SpecialOfferID_ProductIDSpecialOfferIDCLUSTEREDtruetruefalsefalsefalsefalse
SpecialOfferProductPK_SpecialOfferProduct_SpecialOfferID_ProductIDProductIDCLUSTEREDtruetruefalsefalsefalsefalse
StateProvinceAK_StateProvince_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
StateProvinceAK_StateProvince_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
StateProvinceAK_StateProvince_StateProvinceCode_CountryRegionCodeStateProvinceCodeNONCLUSTEREDtruefalsefalsefalsefalsefalse
StateProvinceAK_StateProvince_StateProvinceCode_CountryRegionCodeCountryRegionCodeNONCLUSTEREDtruefalsefalsefalsefalsefalse
StateProvincePK_StateProvince_StateProvinceIDStateProvinceIDCLUSTEREDtruetruefalsefalsefalsefalse
StoreAK_Store_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
StoreIX_Store_SalesPersonIDSalesPersonIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
StorePK_Store_CustomerIDCustomerIDCLUSTEREDtruetruefalsefalsefalsefalse
StorePXML_Store_DemographicsDemographicsXMLfalsefalsefalsefalsefalsefalse
StoreContactAK_StoreContact_rowguidrowguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
StoreContactIX_StoreContact_ContactIDContactIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
StoreContactIX_StoreContact_ContactTypeIDContactTypeIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
StoreContactPK_StoreContact_CustomerID_ContactIDCustomerIDCLUSTEREDtruetruefalsefalsefalsefalse
StoreContactPK_StoreContact_CustomerID_ContactIDContactIDCLUSTEREDtruetruefalsefalsefalsefalse
sysallocunitsclustauidCLUSTEREDtruefalsefalsefalsefalsefalse
sysasymkeysclidCLUSTEREDtruefalsefalsefalsefalsefalse
sysasymkeysnc1nameNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysasymkeysnc3thumbprintNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysbinobjsclstclassCLUSTEREDtruefalsefalsefalsefalsefalse
sysbinobjsclstidCLUSTEREDtruefalsefalsefalsefalsefalse
sysbinobjsnc1classNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysbinobjsnc1nsidNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysbinobjsnc1nameNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysbinsubobjsclstclassCLUSTEREDtruefalsefalsefalsefalsefalse
sysbinsubobjsclstidmajorCLUSTEREDtruefalsefalsefalsefalsefalse
sysbinsubobjsclstsubidCLUSTEREDtruefalsefalsefalsefalsefalse
sysbinsubobjsnc1nameNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysbinsubobjsnc1idmajorNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysbinsubobjsnc1classNONCLUSTEREDtruefalsefalsefalsefalsefalse
syscertsclidCLUSTEREDtruefalsefalsefalsefalsefalse
syscertsnc1nameNONCLUSTEREDtruefalsefalsefalsefalsefalse
syscertsnc2issuerNONCLUSTEREDtruefalsefalsefalsefalsefalse
syscertsnc2snumNONCLUSTEREDtruefalsefalsefalsefalsefalse
syscertsnc3thumbprintNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysclsobjsclstclassCLUSTEREDtruefalsefalsefalsefalsefalse
sysclsobjsclstidCLUSTEREDtruefalsefalsefalsefalsefalse
sysclsobjsncnameNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysclsobjsncclassNONCLUSTEREDtruefalsefalsefalsefalsefalse
syscolparsclstidCLUSTEREDtruefalsefalsefalsefalsefalse
syscolparsclstnumberCLUSTEREDtruefalsefalsefalsefalsefalse
syscolparsclstcolidCLUSTEREDtruefalsefalsefalsefalsefalse
syscolparsncnameNONCLUSTEREDtruefalsefalsefalsefalsefalse
syscolparsncidNONCLUSTEREDtruefalsefalsefalsefalsefalse
syscolparsncnumberNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysconvgroupclstidCLUSTEREDtruefalsefalsefalsefalsefalse
sysdbfilesclstdbidCLUSTEREDtruefalsefalsefalsefalsefalse
sysdbfilesclstfileidCLUSTEREDtruefalsefalsefalsefalsefalse
sysdercvcldiagidCLUSTEREDtruefalsefalsefalsefalsefalse
sysdercvclinitiatorCLUSTEREDtruefalsefalsefalsefalsefalse
sysdesendclhandleCLUSTEREDtruefalsefalsefalsefalsefalse
sysftindsclstidCLUSTEREDtruefalsefalsefalsefalsefalse
sysguidrefsclclassCLUSTEREDtruefalsefalsefalsefalsefalse
sysguidrefsclidCLUSTEREDtruefalsefalsefalsefalsefalse
sysguidrefsclsubidCLUSTEREDtruefalsefalsefalsefalsefalse
sysguidrefsncguidNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysguidrefsncclassNONCLUSTEREDtruefalsefalsefalsefalsefalse
syshobtcolumnsclusthobtidCLUSTEREDtruefalsefalsefalsefalsefalse
syshobtcolumnsclusthobtcolumnidCLUSTEREDtruefalsefalsefalsefalsefalse
syshobtsclusthobtidCLUSTEREDtruefalsefalsefalsefalsefalse
sysidxstatsclstidCLUSTEREDtruefalsefalsefalsefalsefalse
sysidxstatsclstindidCLUSTEREDtruefalsefalsefalsefalsefalse
sysidxstatsncnameNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysidxstatsncidNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysiscolsclstidmajorCLUSTEREDtruefalsefalsefalsefalsefalse
sysiscolsclstidminorCLUSTEREDtruefalsefalsefalsefalsefalse
sysiscolsclstsubidCLUSTEREDtruefalsefalsefalsefalsefalse
sysmultiobjrefsclstclassCLUSTEREDtruefalsefalsefalsefalsefalse
sysmultiobjrefsclstdepidCLUSTEREDtruefalsefalsefalsefalsefalse
sysmultiobjrefsclstdepsubidCLUSTEREDtruefalsefalsefalsefalsefalse
sysmultiobjrefsclstindepidCLUSTEREDtruefalsefalsefalsefalsefalse
sysmultiobjrefsclstindepsubidCLUSTEREDtruefalsefalsefalsefalsefalse
sysmultiobjrefsnc1indepidNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysmultiobjrefsnc1classNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysmultiobjrefsnc1indepsubidNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysmultiobjrefsnc1depidNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysmultiobjrefsnc1depsubidNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysnsobjsclstclassCLUSTEREDtruefalsefalsefalsefalsefalse
sysnsobjsclstidCLUSTEREDtruefalsefalsefalsefalsefalse
sysnsobjsncnameNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysnsobjsncnsidNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysnsobjsncclassNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysobjkeycryptsclclassCLUSTEREDtruefalsefalsefalsefalsefalse
sysobjkeycryptsclidCLUSTEREDtruefalsefalsefalsefalsefalse
sysobjkeycryptsclthumbprintCLUSTEREDtruefalsefalsefalsefalsefalse
sysobjvaluesclstvalclassCLUSTEREDtruefalsefalsefalsefalsefalse
sysobjvaluesclstobjidCLUSTEREDtruefalsefalsefalsefalsefalse
sysobjvaluesclstsubobjidCLUSTEREDtruefalsefalsefalsefalsefalse
sysobjvaluesclstvalnumCLUSTEREDtruefalsefalsefalsefalsefalse
sysownersclstidCLUSTEREDtruefalsefalsefalsefalsefalse
sysownersnc1nameNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysownersnc2sidNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysownersnc2idNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysprivsclustclassCLUSTEREDtruefalsefalsefalsefalsefalse
sysprivsclustidCLUSTEREDtruefalsefalsefalsefalsefalse
sysprivsclustsubidCLUSTEREDtruefalsefalsefalsefalsefalse
sysprivsclustgranteeCLUSTEREDtruefalsefalsefalsefalsefalse
sysprivsclustgrantorCLUSTEREDtruefalsefalsefalsefalsefalse
sysprivsclusttypeCLUSTEREDtruefalsefalsefalsefalsefalse
sysqnamesclstqidCLUSTEREDtruefalsefalsefalsefalsefalse
sysqnamesclsthashCLUSTEREDtruefalsefalsefalsefalsefalse
sysqnamesclstnidCLUSTEREDtruefalsefalsefalsefalsefalse
sysqnamesnc1nidNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysremsvcbindsclstidCLUSTEREDtruefalsefalsefalsefalsefalse
sysremsvcbindsnc1nameNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysremsvcbindsnc2scidNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysremsvcbindsnc2remsvcNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysrowsetcolumnsclustrowsetidCLUSTEREDtruefalsefalsefalsefalsefalse
sysrowsetcolumnsclustrowsetcolidCLUSTEREDtruefalsefalsefalsefalsefalse
sysrowsetrefsclustclassCLUSTEREDtruefalsefalsefalsefalsefalse
sysrowsetrefsclustobjidCLUSTEREDtruefalsefalsefalsefalsefalse
sysrowsetrefsclustindexidCLUSTEREDtruefalsefalsefalsefalsefalse
sysrowsetrefsclustrowsetnumCLUSTEREDtruefalsefalsefalsefalsefalse
sysrowsetsclustrowsetidCLUSTEREDtruefalsefalsefalsefalsefalse
sysrtsclstidCLUSTEREDtruefalsefalsefalsefalsefalse
sysrtsnc1remsvcNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysrtsnc1brkrinstNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysrtsnc1idNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysrtsnc2nameNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysscalartypesclstidCLUSTEREDtruefalsefalsefalsefalsefalse
sysscalartypesnc1schidNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysscalartypesnc1nameNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysscalartypesnc2nameNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysscalartypesnc2schidNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysschobjsclstidCLUSTEREDtruefalsefalsefalsefalsefalse
sysschobjsnc1nsclassNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysschobjsnc1nsidNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysschobjsnc1nameNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysschobjsnc2nameNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysschobjsnc2nsidNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysschobjsnc2nsclassNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysschobjsnc3pidNONCLUSTEREDfalsefalsefalsefalsefalsefalse
sysschobjsnc3pclassNONCLUSTEREDfalsefalsefalsefalsefalsefalse
sysserefsclustclassCLUSTEREDtruefalsefalsefalsefalsefalse
sysserefsclustdepidCLUSTEREDtruefalsefalsefalsefalsefalse
sysserefsclustindepidCLUSTEREDtruefalsefalsefalsefalsefalse
syssingleobjrefsclstclassCLUSTEREDtruefalsefalsefalsefalsefalse
syssingleobjrefsclstdepidCLUSTEREDtruefalsefalsefalsefalsefalse
syssingleobjrefsclstdepsubidCLUSTEREDtruefalsefalsefalsefalsefalse
syssingleobjrefsnc1indepidNONCLUSTEREDtruefalsefalsefalsefalsefalse
syssingleobjrefsnc1classNONCLUSTEREDtruefalsefalsefalsefalsefalse
syssingleobjrefsnc1indepsubidNONCLUSTEREDtruefalsefalsefalsefalsefalse
syssingleobjrefsnc1depidNONCLUSTEREDtruefalsefalsefalsefalsefalse
syssingleobjrefsnc1depsubidNONCLUSTEREDtruefalsefalsefalsefalsefalse
syssqlguidesclstidCLUSTEREDtruefalsefalsefalsefalsefalse
syssqlguidesnc1nameNONCLUSTEREDtruefalsefalsefalsefalsefalse
syssqlguidesnc2scopetypeNONCLUSTEREDtruefalsefalsefalsefalsefalse
syssqlguidesnc2scopeidNONCLUSTEREDtruefalsefalsefalsefalsefalse
syssqlguidesnc2hashNONCLUSTEREDtruefalsefalsefalsefalsefalse
syssqlguidesnc2idNONCLUSTEREDtruefalsefalsefalsefalsefalse
systypedsubobjsclstclassCLUSTEREDtruefalsefalsefalsefalsefalse
systypedsubobjsclstidmajorCLUSTEREDtruefalsefalsefalsefalsefalse
systypedsubobjsclstsubidCLUSTEREDtruefalsefalsefalsefalsefalse
systypedsubobjsncnameNONCLUSTEREDtruefalsefalsefalsefalsefalse
systypedsubobjsncidmajorNONCLUSTEREDtruefalsefalsefalsefalsefalse
systypedsubobjsncclassNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysxmitqueueclstdlgidCLUSTEREDtruefalsefalsefalsefalsefalse
sysxmitqueueclstfinitiatorCLUSTEREDtruefalsefalsefalsefalsefalse
sysxmitqueueclstmsgseqnumCLUSTEREDtruefalsefalsefalsefalsefalse
sysxmlcomponentclidCLUSTEREDtruefalsefalsefalsefalsefalse
sysxmlcomponentnc1xsdidNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysxmlcomponentnc1uriordNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysxmlcomponentnc1qualNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysxmlcomponentnc1nameidNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysxmlcomponentnc1symspaceNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysxmlcomponentnc1nmscopeNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysxmlfacetclcompidCLUSTEREDtruefalsefalsefalsefalsefalse
sysxmlfacetclordCLUSTEREDtruefalsefalsefalsefalsefalse
sysxmlplacementclplacingidCLUSTEREDtruefalsefalsefalsefalsefalse
sysxmlplacementclordinalCLUSTEREDtruefalsefalsefalsefalsefalse
sysxmlplacementnc1placedidNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysxmlplacementnc1placingidNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysxmlplacementnc1ordinalNONCLUSTEREDtruefalsefalsefalsefalsefalse
sysxpropsclustclassCLUSTEREDtruefalsefalsefalsefalsefalse
sysxpropsclustidCLUSTEREDtruefalsefalsefalsefalsefalse
sysxpropsclustsubidCLUSTEREDtruefalsefalsefalsefalsefalse
sysxpropsclustnameCLUSTEREDtruefalsefalsefalsefalsefalse
TransactionHistoryIX_TransactionHistory_ProductIDProductIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
TransactionHistoryIX_TransactionHistory_ReferenceOrderID_ReferenceOrderLineIDReferenceOrderIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
TransactionHistoryIX_TransactionHistory_ReferenceOrderID_ReferenceOrderLineIDReferenceOrderLineIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
TransactionHistoryPK_TransactionHistory_TransactionIDTransactionIDCLUSTEREDtruetruefalsefalsefalsefalse
TransactionHistoryArchiveIX_TransactionHistoryArchive_ProductIDProductIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
TransactionHistoryArchiveIX_TransactionHistoryArchive_ReferenceOrderID_ReferenceOrderLineIDReferenceOrderIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
TransactionHistoryArchiveIX_TransactionHistoryArchive_ReferenceOrderID_ReferenceOrderLineIDReferenceOrderLineIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
TransactionHistoryArchivePK_TransactionHistoryArchive_TransactionIDTransactionIDCLUSTEREDtruetruefalsefalsefalsefalse
ufnGetContactInformationPK__ufnGetContactInf__60083D91ContactIDCLUSTEREDtruetruefalsefalsefalsefalse
UnitMeasureAK_UnitMeasure_NameNameNONCLUSTEREDtruefalsefalsefalsefalsefalse
UnitMeasurePK_UnitMeasure_UnitMeasureCodeUnitMeasureCodeCLUSTEREDtruetruefalsefalsefalsefalse
VendorAK_Vendor_AccountNumberAccountNumberNONCLUSTEREDtruefalsefalsefalsefalsefalse
VendorPK_Vendor_VendorIDVendorIDCLUSTEREDtruetruefalsefalsefalsefalse
VendorAddressIX_VendorAddress_AddressIDAddressIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
VendorAddressPK_VendorAddress_VendorID_AddressIDVendorIDCLUSTEREDtruetruefalsefalsefalsefalse
VendorAddressPK_VendorAddress_VendorID_AddressIDAddressIDCLUSTEREDtruetruefalsefalsefalsefalse
VendorContactIX_VendorContact_ContactIDContactIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
VendorContactIX_VendorContact_ContactTypeIDContactTypeIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
VendorContactPK_VendorContact_VendorID_ContactIDVendorIDCLUSTEREDtruetruefalsefalsefalsefalse
VendorContactPK_VendorContact_VendorID_ContactIDContactIDCLUSTEREDtruetruefalsefalsefalsefalse
vProductAndDescriptionIX_vProductAndDescriptionProductIDCLUSTEREDtruefalsefalsefalsefalsefalse
vProductAndDescriptionIX_vProductAndDescriptionCultureIDCLUSTEREDtruefalsefalsefalsefalsefalse
vStateProvinceCountryRegionIX_vStateProvinceCountryRegionStateProvinceIDCLUSTEREDtruefalsefalsefalsefalsefalse
vStateProvinceCountryRegionIX_vStateProvinceCountryRegionCountryRegionCodeCLUSTEREDtruefalsefalsefalsefalsefalse
WorkOrderIX_WorkOrder_ProductIDProductIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
WorkOrderIX_WorkOrder_ScrapReasonIDScrapReasonIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
WorkOrderPK_WorkOrder_WorkOrderIDWorkOrderIDCLUSTEREDtruetruefalsefalsefalsefalse
WorkOrderRoutingIX_WorkOrderRouting_ProductIDProductIDNONCLUSTEREDfalsefalsefalsefalsefalsefalse
WorkOrderRoutingPK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequenceWorkOrderIDCLUSTEREDtruetruefalsefalsefalsefalse
WorkOrderRoutingPK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequenceProductIDCLUSTEREDtruetruefalsefalsefalsefalse
WorkOrderRoutingPK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequenceOperationSequenceCLUSTEREDtruetruefalsefalsefalsefalse
xml_index_nodes_1269579561_32000PXML_Individual_DemographicsidCLUSTEREDtruefalsefalsefalsefalsefalse
xml_index_nodes_1269579561_32000PXML_Individual_Demographicspk1CLUSTEREDtruefalsefalsefalsefalsefalse
xml_index_nodes_1269579561_32000XMLPATH_Individual_DemographicshidNONCLUSTEREDfalsefalsefalsefalsefalsefalse
xml_index_nodes_1269579561_32000XMLPATH_Individual_DemographicsvalueNONCLUSTEREDfalsefalsefalsefalsefalsefalse
xml_index_nodes_1269579561_32000XMLPROPERTY_Individual_Demographicspk1NONCLUSTEREDfalsefalsefalsefalsefalsefalse
xml_index_nodes_1269579561_32000XMLPROPERTY_Individual_DemographicshidNONCLUSTEREDfalsefalsefalsefalsefalsefalse
xml_index_nodes_1269579561_32000XMLPROPERTY_Individual_DemographicsvalueNONCLUSTEREDfalsefalsefalsefalsefalsefalse
xml_index_nodes_1269579561_32000XMLVALUE_Individual_DemographicsvalueNONCLUSTEREDfalsefalsefalsefalsefalsefalse
xml_index_nodes_1269579561_32000XMLVALUE_Individual_DemographicshidNONCLUSTEREDfalsefalsefalsefalsefalsefalse
xml_index_nodes_2021582240_32000PXML_ProductModel_CatalogDescriptionidCLUSTEREDtruefalsefalsefalsefalsefalse
xml_index_nodes_2021582240_32000PXML_ProductModel_CatalogDescriptionpk1CLUSTEREDtruefalsefalsefalsefalsefalse
xml_index_nodes_2021582240_32001PXML_ProductModel_InstructionsidCLUSTEREDtruefalsefalsefalsefalsefalse
xml_index_nodes_2021582240_32001PXML_ProductModel_Instructionspk1CLUSTEREDtruefalsefalsefalsefalsefalse
xml_index_nodes_2130106629_32000PXML_Store_DemographicsidCLUSTEREDtruefalsefalsefalsefalsefalse
xml_index_nodes_2130106629_32000PXML_Store_Demographicspk1CLUSTEREDtruefalsefalsefalsefalsefalse
xml_index_nodes_309576141_32000PXML_Contact_AddContactidCLUSTEREDtruefalsefalsefalsefalsefalse
xml_index_nodes_309576141_32000PXML_Contact_AddContactpk1CLUSTEREDtruefalsefalsefalsefalsefalse
Triggers
NameTrigger Schema
dEmployeeHumanResources
iWorkOrderProduction
uWorkOrderProduction
iPurchaseOrderDetailPurchasing
uPurchaseOrderDetailPurchasing
uPurchaseOrderHeaderPurchasing
dVendorPurchasing
iduSalesOrderDetailSales
uSalesOrderHeaderSales
iStoreSales
iuIndividualSales
dEmployee
Trigger Body
Text

CREATE TRIGGER [HumanResources].[dEmployee] ON [HumanResources].[Employee] 
INSTEAD OF DELETE NOT FOR REPLICATION AS 
BEGIN
    DECLARE @Count int;

    SET @Count = @@ROWCOUNT;
    IF @Count = 0 
        RETURN;

    SET NOCOUNT ON;

    BEGIN
        RAISERROR
            (N'Employees cannot be deleted. They can only be marked as not current.', -- Message
            10, -- Severity.
            1); -- State.

        -- Rollback any active or uncommittable transactions
        IF @@TRANCOUNT > 0
        BEGIN
            ROLLBACK TRANSACTION;
        END
    END;
END;
Dependent Objects
Dependent ObjDependent Obj Type
iWorkOrder
Trigger Body
Text

CREATE TRIGGER [Production].[iWorkOrder] ON [Production].[WorkOrder] 
AFTER INSERT AS 
BEGIN
    DECLARE @Count int;

    SET @Count = @@ROWCOUNT;
    IF @Count = 0 
        RETURN;

    SET NOCOUNT ON;

    BEGIN TRY
        INSERT INTO [Production].[TransactionHistory](
            [ProductID]
            ,[ReferenceOrderID]
            ,[TransactionType]
            ,[TransactionDate]
            ,[Quantity]
            ,[ActualCost])
        SELECT 
            inserted.[ProductID]
            ,inserted.[WorkOrderID]
            ,'W'
            ,GETDATE()
            ,inserted.[OrderQty]
            ,0
        FROM inserted;
    END TRY
    BEGIN CATCH
        EXECUTE [dbo].[uspPrintError];

        -- Rollback any active or uncommittable transactions before
        -- inserting information in the ErrorLog
        IF @@TRANCOUNT > 0
        BEGIN
            ROLLBACK TRANSACTION;
        END

        EXECUTE [dbo].[uspLogError];
    END CATCH;
END;
Dependent Objects
Dependent ObjDependent Obj Type
uspLogErrorSQL_STORED_PROCEDURE
uspPrintErrorSQL_STORED_PROCEDURE
TransactionHistoryUSER_TABLE
uWorkOrder
Trigger Body
Text

CREATE TRIGGER [Production].[uWorkOrder] ON [Production].[WorkOrder] 
AFTER UPDATE AS 
BEGIN
    DECLARE @Count int;

    SET @Count = @@ROWCOUNT;
    IF @Count = 0 
        RETURN;

    SET NOCOUNT ON;

    BEGIN TRY
        IF UPDATE([ProductID]) OR UPDATE([OrderQty])
        BEGIN
            INSERT INTO [Production].[TransactionHistory](
                [ProductID]
                ,[ReferenceOrderID]
                ,[TransactionType]
                ,[TransactionDate]
                ,[Quantity])
            SELECT 
                inserted.[ProductID]
                ,inserted.[WorkOrderID]
                ,'W'
                ,GETDATE()
                ,inserted.[OrderQty]
            FROM inserted;
        END;
    END TRY
    BEGIN CATCH
        EXECUTE [dbo].[uspPrintError];

        -- Rollback any active or uncommittable transactions before
        -- inserting information in the ErrorLog
        IF @@TRANCOUNT > 0
        BEGIN
            ROLLBACK TRANSACTION;
        END

        EXECUTE [dbo].[uspLogError];
    END CATCH;
END;
Dependent Objects
Dependent ObjDependent Obj Type
uspLogErrorSQL_STORED_PROCEDURE
uspPrintErrorSQL_STORED_PROCEDURE
TransactionHistoryUSER_TABLE
WorkOrderUSER_TABLE
iPurchaseOrderDetail
Trigger Body
Text

CREATE TRIGGER [Purchasing].[iPurchaseOrderDetail] ON [Purchasing].[PurchaseOrderDetail] 
AFTER INSERT AS
BEGIN
    DECLARE @Count int;

    SET @Count = @@ROWCOUNT;
    IF @Count = 0 
        RETURN;

    SET NOCOUNT ON;

    BEGIN TRY
        INSERT INTO [Production].[TransactionHistory]
            ([ProductID]
            ,[ReferenceOrderID]
            ,[ReferenceOrderLineID]
            ,[TransactionType]
            ,[TransactionDate]
            ,[Quantity]
            ,[ActualCost])
        SELECT 
            inserted.[ProductID]
            ,inserted.[PurchaseOrderID]
            ,inserted.[PurchaseOrderDetailID]
            ,'P'
            ,GETDATE()
            ,inserted.[OrderQty]
            ,inserted.[UnitPrice]
        FROM inserted 
            INNER JOIN [Purchasing].[PurchaseOrderHeader] 
            ON inserted.[PurchaseOrderID] = [Purchasing].[PurchaseOrderHeader].[PurchaseOrderID];

        -- Update SubTotal in PurchaseOrderHeader record. Note that this causes the 
        -- PurchaseOrderHeader trigger to fire which will update the RevisionNumber.
        UPDATE [Purchasing].[PurchaseOrderHeader]
        SET [Purchasing].[PurchaseOrderHeader].[SubTotal] = 
            (SELECT SUM([Purchasing].[PurchaseOrderDetail].[LineTotal])
                FROM [Purchasing].[PurchaseOrderDetail]
                WHERE [Purchasing].[PurchaseOrderHeader].[PurchaseOrderID] = [Purchasing].[PurchaseOrderDetail].[PurchaseOrderID])
        WHERE [Purchasing].[PurchaseOrderHeader].[PurchaseOrderID] IN (SELECT inserted.[PurchaseOrderID] FROM inserted);
    END TRY
    BEGIN CATCH
        EXECUTE [dbo].[uspPrintError];

        -- Rollback any active or uncommittable transactions before
        -- inserting information in the ErrorLog
        IF @@TRANCOUNT > 0
        BEGIN
            ROLLBACK TRANSACTION;
        END

        EXECUTE [dbo].[uspLogError];
    END CATCH;
END;
Dependent Objects
Dependent ObjDependent Obj Type
uspLogErrorSQL_STORED_PROCEDURE
uspPrintErrorSQL_STORED_PROCEDURE
PurchaseOrderDetailUSER_TABLE
PurchaseOrderHeaderUSER_TABLE
TransactionHistoryUSER_TABLE
uPurchaseOrderDetail
Trigger Body
Text

CREATE TRIGGER [Purchasing].[uPurchaseOrderDetail] ON [Purchasing].[PurchaseOrderDetail] 
AFTER UPDATE AS 
BEGIN
    DECLARE @Count int;

    SET @Count = @@ROWCOUNT;
    IF @Count = 0 
        RETURN;

    SET NOCOUNT ON;

    BEGIN TRY
        IF UPDATE([ProductID]) OR UPDATE([OrderQty]) OR UPDATE([UnitPrice])
        -- Insert record into TransactionHistory 
        BEGIN
            INSERT INTO [Production].[TransactionHistory]
                ([ProductID]
                ,[ReferenceOrderID]
                ,[ReferenceOrderLineID]
                ,[TransactionType]
                ,[TransactionDate]
                ,[Quantity]
                ,[ActualCost])
            SELECT 
                inserted.[ProductID]
                ,inserted.[PurchaseOrderID]
                ,inserted.[PurchaseOrderDetailID]
                ,'P'
                ,GETDATE()
                ,inserted.[OrderQty]
                ,inserted.[UnitPrice]
            FROM inserted 
                INNER JOIN [Purchasing].[PurchaseOrderDetail] 
                ON inserted.[PurchaseOrderID] = [Purchasing].[PurchaseOrderDetail].[PurchaseOrderID];

            -- Update SubTotal in PurchaseOrderHeader record. Note that this causes the 
            -- PurchaseOrderHeader trigger to fire which will update the RevisionNumber.
            UPDATE [Purchasing].[PurchaseOrderHeader]
            SET [Purchasing].[PurchaseOrderHeader].[SubTotal] = 
                (SELECT SUM([Purchasing].[PurchaseOrderDetail].[LineTotal])
                    FROM [Purchasing].[PurchaseOrderDetail]
                    WHERE [Purchasing].[PurchaseOrderHeader].[PurchaseOrderID] 
                        = [Purchasing].[PurchaseOrderDetail].[PurchaseOrderID])
            WHERE [Purchasing].[PurchaseOrderHeader].[PurchaseOrderID] 
                IN (SELECT inserted.[PurchaseOrderID] FROM inserted);

            UPDATE [Purchasing].[PurchaseOrderDetail]
            SET [Purchasing].[PurchaseOrderDetail].[ModifiedDate] = GETDATE()
            FROM inserted
            WHERE inserted.[PurchaseOrderID] = [Purchasing].[PurchaseOrderDetail].[PurchaseOrderID]
                AND inserted.[PurchaseOrderDetailID] = [Purchasing].[PurchaseOrderDetail].[PurchaseOrderDetailID];
        END;
    END TRY
    BEGIN CATCH
        EXECUTE [dbo].[uspPrintError];

        -- Rollback any active or uncommittable transactions before
        -- inserting information in the ErrorLog
        IF @@TRANCOUNT > 0
        BEGIN
            ROLLBACK TRANSACTION;
        END

        EXECUTE [dbo].[uspLogError];
    END CATCH;
END;
Dependent Objects
Dependent ObjDependent Obj Type
uspLogErrorSQL_STORED_PROCEDURE
uspPrintErrorSQL_STORED_PROCEDURE
PurchaseOrderDetailUSER_TABLE
PurchaseOrderHeaderUSER_TABLE
TransactionHistoryUSER_TABLE
uPurchaseOrderHeader
Trigger Body
Text

CREATE TRIGGER [Purchasing].[uPurchaseOrderHeader] ON [Purchasing].[PurchaseOrderHeader] 
AFTER UPDATE AS 
BEGIN
    DECLARE @Count int;

    SET @Count = @@ROWCOUNT;
    IF @Count = 0 
        RETURN;

    SET NOCOUNT ON;

    BEGIN TRY
        -- Update RevisionNumber for modification of any field EXCEPT the Status.
        IF NOT UPDATE([Status])
        BEGIN
            UPDATE [Purchasing].[PurchaseOrderHeader]
            SET [Purchasing].[PurchaseOrderHeader].[RevisionNumber] = 
                [Purchasing].[PurchaseOrderHeader].[RevisionNumber] + 1
            WHERE [Purchasing].[PurchaseOrderHeader].[PurchaseOrderID] IN 
                (SELECT inserted.[PurchaseOrderID] FROM inserted);
        END;
    END TRY
    BEGIN CATCH
        EXECUTE [dbo].[uspPrintError];

        -- Rollback any active or uncommittable transactions before
        -- inserting information in the ErrorLog
        IF @@TRANCOUNT > 0
        BEGIN
            ROLLBACK TRANSACTION;
        END

        EXECUTE [dbo].[uspLogError];
    END CATCH;
END;
Dependent Objects
Dependent ObjDependent Obj Type
uspLogErrorSQL_STORED_PROCEDURE
uspPrintErrorSQL_STORED_PROCEDURE
PurchaseOrderHeaderUSER_TABLE
dVendor
Trigger Body
Text

CREATE TRIGGER [Purchasing].[dVendor] ON [Purchasing].[Vendor] 
INSTEAD OF DELETE NOT FOR REPLICATION AS 
BEGIN
    DECLARE @Count int;

    SET @Count = @@ROWCOUNT;
    IF @Count = 0 
        RETURN;

    SET NOCOUNT ON;

    BEGIN TRY
        DECLARE @DeleteCount int;

        SELECT @DeleteCount = COUNT(*) FROM deleted;
        IF @DeleteCount > 0 
        BEGIN
            RAISERROR
                (N'Vendors cannot be deleted. They can only be marked as not active.', -- Message
                10, -- Severity.
                1); -- State.

        -- Rollback any active or uncommittable transactions
            IF @@TRANCOUNT > 0
            BEGIN
                ROLLBACK TRANSACTION;
            END
        END;
    END TRY
    BEGIN CATCH
        EXECUTE [dbo].[uspPrintError];

        -- Rollback any active or uncommittable transactions before
        -- inserting information in the ErrorLog
        IF @@TRANCOUNT > 0
        BEGIN
            ROLLBACK TRANSACTION;
        END

        EXECUTE [dbo].[uspLogError];
    END CATCH;
END;
Dependent Objects
Dependent ObjDependent Obj Type
uspLogErrorSQL_STORED_PROCEDURE
uspPrintErrorSQL_STORED_PROCEDURE
iduSalesOrderDetail
Trigger Body
Text

CREATE TRIGGER [Sales].[iduSalesOrderDetail] ON [Sales].[SalesOrderDetail] 
AFTER INSERT, DELETE, UPDATE AS 
BEGIN
    DECLARE @Count int;

    SET @Count = @@ROWCOUNT;
    IF @Count = 0 
        RETURN;

    SET NOCOUNT ON;

    BEGIN TRY
        -- If inserting or updating these columns
        IF UPDATE([ProductID]) OR UPDATE([OrderQty]) OR UPDATE([UnitPrice]) OR UPDATE([UnitPriceDiscount]) 
        -- Insert record into TransactionHistory
        BEGIN
            INSERT INTO [Production].[TransactionHistory]
                ([ProductID]
                ,[ReferenceOrderID]
                ,[ReferenceOrderLineID]
                ,[TransactionType]
                ,[TransactionDate]
                ,[Quantity]
                ,[ActualCost])
            SELECT 
                inserted.[ProductID]
                ,inserted.[SalesOrderID]
                ,inserted.[SalesOrderDetailID]
                ,'S'
                ,GETDATE()
                ,inserted.[OrderQty]
                ,inserted.[UnitPrice]
            FROM inserted 
                INNER JOIN [Sales].[SalesOrderHeader] 
                ON inserted.[SalesOrderID] = [Sales].[SalesOrderHeader].[SalesOrderID];

            UPDATE [Sales].[Individual] 
            SET [Demographics].modify('declare default element namespace 
                "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey"; 
                replace value of (/IndividualSurvey/TotalPurchaseYTD)[1] 
                with data(/IndividualSurvey/TotalPurchaseYTD)[1] + sql:column ("inserted.LineTotal")') 
            FROM inserted 
                INNER JOIN [Sales].[SalesOrderHeader] 
                ON inserted.[SalesOrderID] = [Sales].[SalesOrderHeader].[SalesOrderID] 
            WHERE [Sales].[SalesOrderHeader].[CustomerID] = [Sales].[Individual].[CustomerID];
        END;

        -- Update SubTotal in SalesOrderHeader record. Note that this causes the 
        -- SalesOrderHeader trigger to fire which will update the RevisionNumber.
        UPDATE [Sales].[SalesOrderHeader]
        SET [Sales].[SalesOrderHeader].[SubTotal] = 
            (SELECT SUM([Sales].[SalesOrderDetail].[LineTotal])
                FROM [Sales].[SalesOrderDetail]
                WHERE [Sales].[SalesOrderHeader].[SalesOrderID] = [Sales].[SalesOrderDetail].[SalesOrderID])
        WHERE [Sales].[SalesOrderHeader].[SalesOrderID] IN (SELECT inserted.[SalesOrderID] FROM inserted);

        UPDATE [Sales].[Individual] 
        SET [Demographics].modify('declare default element namespace 
            "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey"; 
            replace value of (/IndividualSurvey/TotalPurchaseYTD)[1] 
            with data(/IndividualSurvey/TotalPurchaseYTD)[1] - sql:column("deleted.LineTotal")') 
        FROM deleted 
            INNER JOIN [Sales].[SalesOrderHeader] 
            ON deleted.[SalesOrderID] = [Sales].[SalesOrderHeader].[SalesOrderID] 
        WHERE [Sales].[SalesOrderHeader].[CustomerID] = [Sales].[Individual].[CustomerID];
    END TRY
    BEGIN CATCH
        EXECUTE [dbo].[uspPrintError];

        -- Rollback any active or uncommittable transactions before
        -- inserting information in the ErrorLog
        IF @@TRANCOUNT > 0
        BEGIN
            ROLLBACK TRANSACTION;
        END

        EXECUTE [dbo].[uspLogError];
    END CATCH;
END;
Dependent Objects
Dependent ObjDependent Obj Type
uspLogErrorSQL_STORED_PROCEDURE
uspPrintErrorSQL_STORED_PROCEDURE
IndividualUSER_TABLE
SalesOrderDetailUSER_TABLE
SalesOrderHeaderUSER_TABLE
TransactionHistoryUSER_TABLE
uSalesOrderHeader
Trigger Body
Text

CREATE TRIGGER [Sales].[uSalesOrderHeader] ON [Sales].[SalesOrderHeader] 
AFTER UPDATE NOT FOR REPLICATION AS 
BEGIN
    DECLARE @Count int;

    SET @Count = @@ROWCOUNT;
    IF @Count = 0 
        RETURN;

    SET NOCOUNT ON;

    BEGIN TRY
        -- Update RevisionNumber for modification of any field EXCEPT the Status.
        IF NOT UPDATE([Status])
        BEGIN
            UPDATE [Sales].[SalesOrderHeader]
            SET [Sales].[SalesOrderHeader].[RevisionNumber] = 
                [Sales].[SalesOrderHeader].[RevisionNumber] + 1
            WHERE [Sales].[SalesOrderHeader].[SalesOrderID] IN 
                (SELECT inserted.[SalesOrderID] FROM inserted);
        END;

        -- Update the SalesPerson SalesYTD when SubTotal is updated
        IF UPDATE([SubTotal])
        BEGIN
            DECLARE @StartDate datetime,
                    @EndDate datetime

            SET @StartDate = [dbo].[ufnGetAccountingStartDate]();
            SET @EndDate = [dbo].[ufnGetAccountingEndDate]();

            UPDATE [Sales].[SalesPerson]
            SET [Sales].[SalesPerson].[SalesYTD] = 
                (SELECT SUM([Sales].[SalesOrderHeader].[SubTotal])
                FROM [Sales].[SalesOrderHeader] 
                WHERE [Sales].[SalesPerson].[SalesPersonID] = [Sales].[SalesOrderHeader].[SalesPersonID]
                    AND ([Sales].[SalesOrderHeader].[Status] = 5) -- Shipped
                    AND [Sales].[SalesOrderHeader].[OrderDate] BETWEEN @StartDate AND @EndDate)
            WHERE [Sales].[SalesPerson].[SalesPersonID] 
                IN (SELECT DISTINCT inserted.[SalesPersonID] FROM inserted 
                    WHERE inserted.[OrderDate] BETWEEN @StartDate AND @EndDate);

            -- Update the SalesTerritory SalesYTD when SubTotal is updated
            UPDATE [Sales].[SalesTerritory]
            SET [Sales].[SalesTerritory].[SalesYTD] = 
                (SELECT SUM([Sales].[SalesOrderHeader].[SubTotal])
                FROM [Sales].[SalesOrderHeader] 
                WHERE [Sales].[SalesTerritory].[TerritoryID] = [Sales].[SalesOrderHeader].[TerritoryID]
                    AND ([Sales].[SalesOrderHeader].[Status] = 5) -- Shipped
                    AND [Sales].[SalesOrderHeader].[OrderDate] BETWEEN @StartDate AND @EndDate)
            WHERE [Sales].[SalesTerritory].[TerritoryID] 
                IN (SELECT DISTINCT inserted.[TerritoryID] FROM inserted 
                    WHERE inserted.[OrderDate] BETWEEN @StartDate AND @EndDate);
        END;
    END TRY
    BEGIN CATCH
        EXECUTE [dbo].[uspPrintError];

        -- Rollback any active or uncommittable transactions before
        -- inserting information in the ErrorLog
        IF @@TRANCOUNT > 0
        BEGIN
            ROLLBACK TRANSACTION;
        END

        EXECUTE [dbo].[uspLogError];
    END CATCH;
END;
Dependent Objects
Dependent ObjDependent Obj Type
uspLogErrorSQL_STORED_PROCEDURE
uspPrintErrorSQL_STORED_PROCEDURE
SalesOrderHeaderUSER_TABLE
SalesPersonUSER_TABLE
SalesTerritoryUSER_TABLE
iStore
Trigger Body
Text

CREATE TRIGGER [Sales].[iStore] ON [Sales].[Store] 
AFTER INSERT AS 
BEGIN
    DECLARE @Count int;

    SET @Count = @@ROWCOUNT;
    IF @Count = 0 
        RETURN;

    SET NOCOUNT ON;

    BEGIN TRY
        -- Only allow the Customer to be a Store OR Individual
        IF EXISTS (SELECT * FROM inserted INNER JOIN [Sales].[Individual] 
            ON inserted.[CustomerID] = [Sales].[Individual].[CustomerID]) 
        BEGIN
            -- Rollback any active or uncommittable transactions
            IF @@TRANCOUNT > 0
            BEGIN
                ROLLBACK TRANSACTION;
            END
        END;
    END TRY
    BEGIN CATCH
        EXECUTE [dbo].[uspPrintError];

        -- Rollback any active or uncommittable transactions before
        -- inserting information in the ErrorLog
        IF @@TRANCOUNT > 0
        BEGIN
            ROLLBACK TRANSACTION;
        END

        EXECUTE [dbo].[uspLogError];
    END CATCH;
END;
Dependent Objects
Dependent ObjDependent Obj Type
uspLogErrorSQL_STORED_PROCEDURE
uspPrintErrorSQL_STORED_PROCEDURE
IndividualUSER_TABLE
iuIndividual
Trigger Body
Text

CREATE TRIGGER [Sales].[iuIndividual] ON [Sales].[Individual] 
AFTER INSERT, UPDATE NOT FOR REPLICATION AS 
BEGIN
    DECLARE @Count int;

    SET @Count = @@ROWCOUNT;
    IF @Count = 0 
        RETURN;

    SET NOCOUNT ON;

    -- Only allow the Customer to be a Store OR Individual
    IF EXISTS (SELECT * FROM inserted INNER JOIN [Sales].[Store] 
        ON inserted.[CustomerID] = [Sales].[Store].[CustomerID]) 
    BEGIN
        -- Rollback any active or uncommittable transactions
        IF @@TRANCOUNT > 0
        BEGIN
            ROLLBACK TRANSACTION;
        END
    END;

    IF UPDATE([CustomerID]) OR UPDATE([Demographics]) 
    BEGIN
        UPDATE [Sales].[Individual] 
        SET [Sales].[Individual].[Demographics] = N' 
            0.00 
            ' 
        FROM inserted 
        WHERE [Sales].[Individual].[CustomerID] = inserted.[CustomerID] 
            AND inserted.[Demographics] IS NULL;
        
        UPDATE [Sales].[Individual] 
        SET [Demographics].modify(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey"; 
            insert 0.00 
            as first 
            into (/IndividualSurvey)[1]') 
        FROM inserted 
        WHERE [Sales].[Individual].[CustomerID] = inserted.[CustomerID] 
            AND inserted.[Demographics] IS NOT NULL 
            AND inserted.[Demographics].exist(N'declare default element namespace 
                "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey"; 
                /IndividualSurvey/TotalPurchaseYTD') <> 1;
    END;
END;
Dependent Objects
Dependent ObjDependent Obj Type
IndividualUSER_TABLE
StoreUSER_TABLE