Difference between revisions of "Sales.SalesTerritory (table)"
| Line 2: | Line 2: | ||
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
| − | |- | + | |- valign="top" |
| '''Table | | '''Table | ||
| Sales.SalesTerritory | | Sales.SalesTerritory | ||
| Line 8: | Line 8: | ||
| '''Description | | '''Description | ||
| Sales territory lookup table. | | Sales territory lookup table. | ||
| − | |||
|} | |} | ||
| − | |||
=== Columns === | === Columns === | ||
| Line 20: | Line 18: | ||
| '''Default | | '''Default | ||
| '''Description | | '''Description | ||
| − | + | ||
|- valign="top" | |- valign="top" | ||
| TerritoryID | | TerritoryID | ||
| Line 88: | Line 86: | ||
| '''Primary Key | | '''Primary Key | ||
| '''Columns | | '''Columns | ||
| − | |- | + | |- valign="top" |
| PK_SalesTerritory_TerritoryID | | PK_SalesTerritory_TerritoryID | ||
| TerritoryID | | TerritoryID | ||
| Line 99: | Line 97: | ||
| '''Type | | '''Type | ||
| '''Columns | | '''Columns | ||
| − | + | ||
| − | |- | + | |- valign="top" |
| AK_SalesTerritory_Name | | AK_SalesTerritory_Name | ||
| Unique | | Unique | ||
| Name | | Name | ||
| − | |- | + | |- valign="top" |
| AK_SalesTerritory_rowguid | | AK_SalesTerritory_rowguid | ||
| Unique | | Unique | ||
| Line 116: | Line 114: | ||
| '''Expression | | '''Expression | ||
| '''Description | | '''Description | ||
| − | + | ||
| − | |- | + | |- valign="top" |
| CK_SalesTerritory_CostLastYear | | CK_SalesTerritory_CostLastYear | ||
| ([CostLastYear]>=(0.00)) | | ([CostLastYear]>=(0.00)) | ||
| Check constraint [CostLastYear] >= (0.00) | | Check constraint [CostLastYear] >= (0.00) | ||
| − | |- | + | |- valign="top" |
| CK_SalesTerritory_CostYTD | | CK_SalesTerritory_CostYTD | ||
| ([CostYTD]>=(0.00)) | | ([CostYTD]>=(0.00)) | ||
| Check constraint [CostYTD] >= (0.00) | | Check constraint [CostYTD] >= (0.00) | ||
| − | |- | + | |- valign="top" |
| CK_SalesTerritory_SalesLastYear | | CK_SalesTerritory_SalesLastYear | ||
| ([SalesLastYear]>=(0.00)) | | ([SalesLastYear]>=(0.00)) | ||
| Check constraint [SalesLastYear] >= (0.00) | | Check constraint [SalesLastYear] >= (0.00) | ||
| − | |- | + | |- valign="top" |
| CK_SalesTerritory_SalesYTD | | CK_SalesTerritory_SalesYTD | ||
| ([SalesYTD]>=(0.00)) | | ([SalesYTD]>=(0.00)) | ||
| Line 141: | Line 139: | ||
| '''Column | | '''Column | ||
| '''Referencing Column | | '''Referencing Column | ||
| − | + | ||
| − | |- | + | |- valign="top" |
| [[Sales.Customer_(table)|Sales.Customer]] | | [[Sales.Customer_(table)|Sales.Customer]] | ||
| TerritoryID | | TerritoryID | ||
| TerritoryID | | TerritoryID | ||
| − | |- | + | |- valign="top" |
| [[Sales.SalesOrderHeader_(table)|Sales.SalesOrderHeader]] | | [[Sales.SalesOrderHeader_(table)|Sales.SalesOrderHeader]] | ||
| TerritoryID | | TerritoryID | ||
| TerritoryID | | TerritoryID | ||
| − | |- | + | |- valign="top" |
| [[Sales.SalesPerson_(table)|Sales.SalesPerson]] | | [[Sales.SalesPerson_(table)|Sales.SalesPerson]] | ||
| TerritoryID | | TerritoryID | ||
| TerritoryID | | TerritoryID | ||
| − | |- | + | |- valign="top" |
| [[Sales.SalesTerritoryHistory_(table)|Sales.SalesTerritoryHistory]] | | [[Sales.SalesTerritoryHistory_(table)|Sales.SalesTerritoryHistory]] | ||
| TerritoryID | | TerritoryID | ||
| TerritoryID | | TerritoryID | ||
| − | |- | + | |- valign="top" |
| [[Person.StateProvince_(table)|Person.StateProvince]] | | [[Person.StateProvince_(table)|Person.StateProvince]] | ||
| TerritoryID | | TerritoryID | ||
| Line 171: | Line 169: | ||
| '''Referenced Object | | '''Referenced Object | ||
| − | |- | + | |- valign="top" |
| Data Type | | Data Type | ||
| Type | | Type | ||
| [[dbo.Name_(type)|dbo.Name]] | | [[dbo.Name_(type)|dbo.Name]] | ||
| − | |- | + | |- valign="top" |
| Schema | | Schema | ||
| Schema | | Schema | ||
| Line 193: | Line 191: | ||
| '''Child Object | | '''Child Object | ||
| − | |- | + | |- valign="top" |
| Select | | Select | ||
| View | | View | ||
| Line 200: | Line 198: | ||
| | | | ||
| | | | ||
| − | |- | + | |- valign="top" |
| Select | | Select | ||
| View | | View | ||
| Line 207: | Line 205: | ||
| | | | ||
| | | | ||
| − | |- | + | |- valign="top" |
| Update | | Update | ||
| Table | | Table | ||
Revision as of 23:17, 23 June 2010
Contents
wikibot
| Table | Sales.SalesTerritory |
| Description | Sales territory lookup table. |
Columns
| Column | Data Type | Nullable | Default | Description |
| TerritoryID | int | not null | Primary key for SalesTerritory records. | |
| Name | dbo.Name | not null | Sales territory description | |
| CountryRegionCode | nvarchar(3) | not null | ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode. | |
| Group | nvarchar(50) | not null | Geographic area to which the sales territory belong. | |
| SalesYTD | money | not null | ((0.00)) | Sales in the territory year to date. |
| SalesLastYear | money | not null | ((0.00)) | Sales in the territory the previous year. |
| CostYTD | money | not null | ((0.00)) | Business costs in the territory year to date. |
| CostLastYear | money | not null | ((0.00)) | Business costs in the territory the previous year. |
| rowguid | uniqueidentifier | not null | (newid()) | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| ModifiedDate | datetime | not null | (getdate()) | Date and time the record was last updated. |
Primary Key
| Primary Key | Columns |
| PK_SalesTerritory_TerritoryID | TerritoryID |
Indexes
| Index | Type | Columns |
| AK_SalesTerritory_Name | Unique | Name |
| AK_SalesTerritory_rowguid | Unique | rowguid |
Check Constraints
| Check Constraint | Expression | Description |
| 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) |
Detail Tables
| Detail Table | Column | Referencing Column |
| Sales.Customer | TerritoryID | TerritoryID |
| Sales.SalesOrderHeader | TerritoryID | TerritoryID |
| Sales.SalesPerson | TerritoryID | TerritoryID |
| Sales.SalesTerritoryHistory | TerritoryID | TerritoryID |
| Person.StateProvince | TerritoryID | TerritoryID |
References
| Dependency Type | Object Type | Referenced Object |
| Data Type | Type | dbo.Name |
| Schema | Schema | Sales |
Dependencies
| Reference Type | Object Type | Referencing Object | Child Type | Child Object |
| Select | View | Sales.vSalesPerson | ||
| Select | View | Sales.vSalesPersonSalesByFiscalYears | ||
| Update | Table | Sales.SalesOrderHeader | Trigger | uSalesOrderHeader |
wikivalues
| Table Values | Sales.SalesTerritory |
| TerritoryID | Name | CountryRegionCode | Group |
| 1 | Northwest | US | North America |
| 2 | Northeast | US | North America |
| 3 | Central | US | North America |
| 4 | Southwest | US | North America |
| 5 | Southeast | US | North America |
| 6 | Canada | CA | North America |
| 7 | France | FR | Europe |
| 8 | Germany | DE | Europe |
| 9 | Australia | AU | Pacific |
| 10 | United Kingdom | GB | Europe |
automatically generated
| Table | Sales.SalesTerritory |
| Description | Sales territory lookup table. |
| Column | Data Type | Nullable | Default | Description / PK / Index |
| TerritoryID | int | not null | Primary key for SalesTerritory records. PK_SalesTerritory_TerritoryID | |
| Name | Name | not null | Sales territory description AK_SalesTerritory_Name | |
| CountryRegionCode | nvarchar(3) | not null | ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode. | |
| Group | nvarchar(50) | not null | Geographic area to which the sales territory belong. | |
| SalesYTD | money | not null | (0.00) | Sales in the territory year to date. |
| SalesLastYear | money | not null | (0.00) | Sales in the territory the previous year. |
| CostYTD | money | not null | (0.00) | Business costs in the territory year to date. |
| CostLastYear | money | not null | (0.00) | Business costs in the territory the previous year. |
| rowguid | uniqueidentifier | not null | (NEWID()) | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. AK_SalesTerritory_rowguid |
| ModifiedDate | datetime | not null | (GETDATE()) | Date and time the record was last updated. |
| Detail Table | Column | Referencing Column |
| Sales.Customer | TerritoryID | TerritoryID |
| Sales.SalesOrderHeader | TerritoryID | TerritoryID |
| Sales.SalesPerson | TerritoryID | TerritoryID |
| Sales.SalesTerritoryHistory | TerritoryID | TerritoryID |
| Person.StateProvince | TerritoryID | TerritoryID |
| Dependency Type | Object Type | Referenced Object |
| Data Type | Type | dbo.Name |
| Schema | Schema | Sales |
| Reference Type | Object Type | Referencing Object | Child Type | Child Object |
| Select | View | Sales.vSalesPerson | ||
| Select | View | Sales.vSalesPersonSalesByFiscalYears | ||
| Update | Table | Sales.SalesOrderHeader | Trigger | uSalesOrderHeader |