Difference between revisions of "Sales.SalesTerritoryHistory (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.SalesTerritoryHistory | | Sales.SalesTerritoryHistory | ||
Line 8: | Line 8: | ||
| '''Description | | '''Description | ||
| Sales representative transfers to other sales territories. | | Sales representative transfers to other sales territories. | ||
− | |||
|} | |} | ||
− | |||
=== Columns === | === Columns === | ||
Line 20: | Line 18: | ||
| '''Default | | '''Default | ||
| '''Description | | '''Description | ||
− | + | ||
|- valign="top" | |- valign="top" | ||
| SalesPersonID | | SalesPersonID | ||
Line 64: | Line 62: | ||
| '''Primary Key | | '''Primary Key | ||
| '''Columns | | '''Columns | ||
− | |- | + | |- valign="top" |
| PK_SalesTerritoryHistory_SalesPersonID_StartDate_TerritoryID | | PK_SalesTerritoryHistory_SalesPersonID_StartDate_TerritoryID | ||
| SalesPersonID, TerritoryID, StartDate | | SalesPersonID, TerritoryID, StartDate | ||
Line 75: | Line 73: | ||
| '''Type | | '''Type | ||
| '''Columns | | '''Columns | ||
− | + | ||
− | |- | + | |- valign="top" |
| AK_SalesTerritoryHistory_rowguid | | AK_SalesTerritoryHistory_rowguid | ||
| Unique | | Unique | ||
Line 88: | Line 86: | ||
| '''Expression | | '''Expression | ||
| '''Description | | '''Description | ||
− | + | ||
− | |- | + | |- valign="top" |
| CK_SalesTerritoryHistory_EndDate | | CK_SalesTerritoryHistory_EndDate | ||
| ([EndDate]>=[StartDate] OR [EndDate] IS NULL) | | ([EndDate]>=[StartDate] OR [EndDate] IS NULL) | ||
Line 101: | Line 99: | ||
| '''Column | | '''Column | ||
| '''Referenced Column | | '''Referenced Column | ||
− | + | ||
− | |- | + | |- valign="top" |
| [[Sales.SalesPerson_(table)|Sales.SalesPerson]] | | [[Sales.SalesPerson_(table)|Sales.SalesPerson]] | ||
| SalesPersonID | | SalesPersonID | ||
| SalesPersonID | | SalesPersonID | ||
− | |- | + | |- valign="top" |
| [[Sales.SalesTerritory_(table)|Sales.SalesTerritory]] | | [[Sales.SalesTerritory_(table)|Sales.SalesTerritory]] | ||
| TerritoryID | | TerritoryID | ||
Line 119: | Line 117: | ||
| '''Referenced Object | | '''Referenced Object | ||
− | |- | + | |- valign="top" |
| Schema | | Schema | ||
| Schema | | Schema |
Latest revision as of 00:17, 24 June 2010
Contents
[hide]wikibot[edit]
Table | Sales.SalesTerritoryHistory |
Description | Sales representative transfers to other sales territories. |
Columns[edit]
Column | Data Type | Nullable | Default | Description |
SalesPersonID | int | not null | Primary key for SalesTerritoryHistory records. | |
TerritoryID | int | not null | Territory identification number. Foreign key to SalesTerritory.SalesTerritoryID. | |
StartDate | datetime | not null | Date the sales representive started work in the territory. | |
EndDate | datetime | null | Date the sales representative left work in the territory. | |
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[edit]
Primary Key | Columns |
PK_SalesTerritoryHistory_SalesPersonID_StartDate_TerritoryID | SalesPersonID, TerritoryID, StartDate |
Indexes[edit]
Index | Type | Columns |
AK_SalesTerritoryHistory_rowguid | Unique | rowguid |
Check Constraints[edit]
Check Constraint | Expression | Description |
CK_SalesTerritoryHistory_EndDate | ([EndDate]>=[StartDate] OR [EndDate] IS NULL) | Check constraint [EndDate] >= [StartDate] OR [EndDate] IS NULL |
Foreign Keys[edit]
Relation | Column | Referenced Column |
Sales.SalesPerson | SalesPersonID | SalesPersonID |
Sales.SalesTerritory | TerritoryID | TerritoryID |
References[edit]
Dependency Type | Object Type | Referenced Object |
Schema | Schema | Sales |
automatically generated[edit]
Table | Sales.SalesTerritoryHistory |
Description | Sales representative transfers to other sales territories. |
Column | Data Type | Nullable | Default | Description / PK / Index |
SalesPersonID | int | not null | Primary key for SalesTerritoryHistory records. PK_SalesTerritoryHistory_SalesPersonID_StartDate_TerritoryID | |
TerritoryID | int | not null | Territory identification number. Foreign key to SalesTerritory.SalesTerritoryID. PK_SalesTerritoryHistory_SalesPersonID_StartDate_TerritoryID | |
StartDate | datetime | not null | Date the sales representive started work in the territory. PK_SalesTerritoryHistory_SalesPersonID_StartDate_TerritoryID | |
EndDate | datetime | null | Date the sales representative left work in the territory. | |
rowguid | uniqueidentifier | not null | (NEWID()) | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. AK_SalesTerritoryHistory_rowguid |
ModifiedDate | datetime | not null | (GETDATE()) | Date and time the record was last updated. |
Relation | Column | Referenced Column |
Sales.SalesPerson | SalesPersonID | SalesPersonID |
Sales.SalesTerritory | TerritoryID | TerritoryID |
Dependency Type | Object Type | Referenced Object |
Schema | Schema | Sales |