ScrewTurn Wiki

Edit

wikibot

TableSales.SalesTerritory
DescriptionSales territory lookup table.

Edit

Columns

ColumnData TypeNullableDefaultDescription
TerritoryIDintnot null Primary key for SalesTerritory records.
Namedbo.Namenot null Sales territory description
CountryRegionCodenvarchar(3)not null ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode.
Groupnvarchar(50)not null Geographic area to which the sales territory belong.
SalesYTDmoneynot null((0.00))Sales in the territory year to date.
SalesLastYearmoneynot null((0.00))Sales in the territory the previous year.
CostYTDmoneynot null((0.00))Business costs in the territory year to date.
CostLastYearmoneynot null((0.00))Business costs in the territory the previous year.
rowguiduniqueidentifiernot null(newid())ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetimenot null(getdate())Date and time the record was last updated.

Edit

Primary Key

Primary KeyColumns
PK_SalesTerritory_TerritoryIDTerritoryID

Edit

Indexes

IndexTypeColumns
AK_SalesTerritory_NameUniqueName
AK_SalesTerritory_rowguidUniquerowguid

Edit

Check Constraints

Check ConstraintExpressionDescription
CK_SalesTerritory_CostLastYear(CostLastYear>=(0.00))Check constraint CostLastYear >= (0.00)
CK_SalesTerritory_CostYTD(CostYTD>=(0.00))Check constraint CostYTD >= (0.00)
CK_SalesTerritory_SalesLastYear(SalesLastYear>=(0.00))Check constraint SalesLastYear >= (0.00)
CK_SalesTerritory_SalesYTD(SalesYTD>=(0.00))Check constraint SalesYTD >= (0.00)

Edit

Detail Tables

Detail TableColumnReferencing Column
Sales.CustomerTerritoryIDTerritoryID
Sales.SalesOrderHeaderTerritoryIDTerritoryID
Sales.SalesPersonTerritoryIDTerritoryID
Sales.SalesTerritoryHistoryTerritoryIDTerritoryID
Person.StateProvinceTerritoryIDTerritoryID

Edit

References

Dependency TypeObject TypeReferenced Object
Data TypeTypedbo.Name
SchemaSchemaSales

Edit

Dependencies

Reference TypeObject TypeReferencing ObjectChild TypeChild Object
SelectViewSales.vSalesPerson  
SelectViewSales.vSalesPersonSalesByFiscalYears  
UpdateTableSales.SalesOrderHeaderTriggeruSalesOrderHeader

Edit

wikivalues

Table ValuesSales.SalesTerritory

TerritoryIDNameCountryRegionCodeGroup
1NorthwestUSNorth America
2NortheastUSNorth America
3CentralUSNorth America
4SouthwestUSNorth America
5SoutheastUSNorth America
6CanadaCANorth America
7FranceFREurope
8GermanyDEEurope
9AustraliaAUPacific
10United KingdomGBEurope

Edit

automatically generated

TableSales.SalesTerritory
DescriptionSales territory lookup table.

ColumnData TypeNullableDefaultDescription / PK / Index
TerritoryIDintnot null Primary key for SalesTerritory records.
PK_SalesTerritory_TerritoryID
NameNamenot null Sales territory description
AK_SalesTerritory_Name
CountryRegionCodenvarchar(3)not null ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode.
Groupnvarchar(50)not null Geographic area to which the sales territory belong.
SalesYTDmoneynot null(0.00)Sales in the territory year to date.
SalesLastYearmoneynot null(0.00)Sales in the territory the previous year.
CostYTDmoneynot null(0.00)Business costs in the territory year to date.
CostLastYearmoneynot null(0.00)Business costs in the territory the previous year.
rowguiduniqueidentifiernot null(NEWID())ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
AK_SalesTerritory_rowguid
ModifiedDatedatetimenot null(GETDATE())Date and time the record was last updated.



Detail TableColumnReferencing Column
Sales.CustomerTerritoryIDTerritoryID
Sales.SalesOrderHeaderTerritoryIDTerritoryID
Sales.SalesPersonTerritoryIDTerritoryID
Sales.SalesTerritoryHistoryTerritoryIDTerritoryID
Person.StateProvinceTerritoryIDTerritoryID

Dependency TypeObject TypeReferenced Object
Data TypeTypedbo.Name
SchemaSchemaSales

Reference TypeObject TypeReferencing ObjectChild TypeChild Object
SelectViewSales.vSalesPerson
SelectViewSales.vSalesPersonSalesByFiscalYears
UpdateTableSales.SalesOrderHeaderTriggeruSalesOrderHeader

ScrewTurn Wiki version 2.0.36. Some of the icons created by FamFamFam.