Tables SQL 2005 Adventure Works OLTP

Sales.SalesTerritory

Object type: Table

Sales territory lookup table.

Columns 

Name  Data type  Nullable  Description 
TerritoryID  int  No Column has identity seed value of 1 with a step value of 1.
Primary key for SalesTerritory records. 
Name  Name  No Sales territory description 
CountryRegionCode  nvarchar(3)  No ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode. 
Group  nvarchar(50)  No Geographic area to which the sales territory belong. 
SalesYTD  money  No Default value: 0.00
Sales in the territory year to date. 
SalesLastYear  money  No Default value: 0.00
Sales in the territory the previous year. 
CostYTD  money  No Default value: 0.00
Business costs in the territory year to date. 
CostLastYear  money  No Default value: 0.00
Business costs in the territory the previous year. 
rowguid  uniqueidentifier  No Default value: NEWID()
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. 
ModifiedDate  datetime  No Default value: GETDATE()
Date and time the record was last updated. 

Constraints 

Name  Type  Columns  Description 
DF_SalesTerritory_SalesYTD  DEFAULT  SalesYTD  Value: 0.00
Default constraint value of 0.0 
DF_SalesTerritory_SalesLastYear  DEFAULT  SalesLastYear  Value: 0.00
Default constraint value of 0.0 
DF_SalesTerritory_CostYTD  DEFAULT  CostYTD  Value: 0.00
Default constraint value of 0.0 
DF_SalesTerritory_CostLastYear  DEFAULT  CostLastYear  Value: 0.00
Default constraint value of 0.0 
DF_SalesTerritory_rowguid  DEFAULT  rowguid  Value: NEWID()
Default constraint value of NEWID() 
DF_SalesTerritory_ModifiedDate  DEFAULT  ModifiedDate  Value: GETDATE()
Default constraint value of GETDATE() 
CK_SalesTerritory_SalesYTD  CHECK  N/A  Value: ([SalesYTD] >= 0.00)
Check constraint [SalesYTD]>=(0.00) 
CK_SalesTerritory_SalesLastYear  CHECK  N/A  Value: ([SalesLastYear] >= 0.00)
Check constraint [SalesLastYear]>=(0.00) 
CK_SalesTerritory_CostYTD  CHECK  N/A  Value: ([CostYTD] >= 0.00)
Check constraint [CostYTD]>=(0.00) 
CK_SalesTerritory_CostLastYear  CHECK  N/A  Value: ([CostLastYear] >= 0.00)
Check constraint [CostLastYear]>=(0.00) 
PK_SalesTerritory_TerritoryID  PRIMARY KEY  TerritoryID  Clustered index created by a primary key constraint. 

Indices 

Name  Description 
AK_SalesTerritory_Name  Unique nonclustered index. 
AK_SalesTerritory_rowguid  Unique nonclustered index.Used to support replication samples. 

Triggers 

Name  Description 
Sales.uSalesTerritory  AFTER UPDATE trigger setting the ModifiedDate column in the SalesTerritory table to the current date. 

Linked tables 

Name  Description 
Person.StateProvince  State and province lookup table. 
Sales.Customer  Current customer information. Also see the Individual and Store tables. 
Sales.SalesOrderHeader  General sales order information. 
Sales.SalesPerson  Sales representative current information. 
Sales.SalesTerritoryHistory  Sales representative transfers to other sales territories. 

Accessed by 

Name  Description 
Sales.vSalesPerson  Sales representiatives (names and addresses) and their sales-related information. 
Sales.vSalesPersonSalesByFiscalYears  Uses PIVOT to return aggregated sales information for each sales representative. 
Territory Sales Drilldown  Adventure Works sales by territory. This report drills down through salesperson and order number with drillthrough to individual orders. This report illustrates the use of a table data region that provides drilldown from summary data into detail data by showing and hiding rows. This report also illustrates the use of drillthrough links and conditional formatting. 

Modified by 

Name  Description 
Sales.uSalesOrderHeader  AFTER UPDATE trigger that updates the RevisionNumber and ModifiedDate columns in the SalesOrderHeader table.Updates the SalesYTD column in the SalesPerson and SalesTerritory tables. 
Sales.uSalesTerritory  AFTER UPDATE trigger setting the ModifiedDate column in the SalesTerritory table to the current date. 

Applies to

Tables | User
The AdventureWorks database sample was developed by Microsoft Corporation, copyright 2005. SQL Server is a trademark of Microsoft Corporation

Document was prepared on: Thursday, April 05, 2007
Help compiled by DBDocumentor, a Pikauba Software product. All rights reserved.