Difference between revisions of "Sales.SalesTerritoryHistory (table)"
(8 intermediate revisions by the same user not shown) | |||
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 | ||
− | |- | + | |- valign="top" |
+ | | '''Description | ||
+ | | Sales representative transfers to other sales territories. | ||
|} | |} | ||
− | + | === Columns === | |
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
|- style="background:silver" | |- style="background:silver" | ||
Line 15: | Line 17: | ||
| '''Nullable | | '''Nullable | ||
| '''Default | | '''Default | ||
− | | ''' | + | | '''Description |
− | + | ||
− | + | |- valign="top" | |
− | |- | ||
| SalesPersonID | | SalesPersonID | ||
| int | | int | ||
| not null | | not null | ||
| | | | ||
− | | | + | | Primary key for SalesTerritoryHistory records. |
− | + | |- valign="top" | |
− | |- | ||
| TerritoryID | | TerritoryID | ||
| int | | int | ||
| not null | | not null | ||
| | | | ||
− | | | + | | Territory identification number. Foreign key to SalesTerritory.SalesTerritoryID. |
− | + | |- valign="top" | |
− | |- | ||
| StartDate | | StartDate | ||
| datetime | | datetime | ||
| not null | | not null | ||
| | | | ||
− | | | + | | Date the sales representive started work in the territory. |
− | + | |- valign="top" | |
− | |- | ||
| EndDate | | EndDate | ||
| datetime | | datetime | ||
| null | | null | ||
| | | | ||
− | | | + | | Date the sales representative left work in the territory. |
− | + | |- valign="top" | |
− | |- | ||
| rowguid | | rowguid | ||
| uniqueidentifier | | uniqueidentifier | ||
| not null | | not null | ||
| (newid()) | | (newid()) | ||
− | | | + | | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
− | + | |- valign="top" | |
− | |- | ||
| ModifiedDate | | ModifiedDate | ||
| datetime | | datetime | ||
| not null | | not null | ||
| (getdate()) | | (getdate()) | ||
− | | | + | | Date and time the record was last updated. |
− | | | + | |} |
+ | |||
+ | === Primary Key === | ||
+ | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
+ | |- style="background:silver" | ||
+ | | '''Primary Key | ||
+ | | '''Columns | ||
+ | |- valign="top" | ||
+ | | PK_SalesTerritoryHistory_SalesPersonID_StartDate_TerritoryID | ||
+ | | SalesPersonID, TerritoryID, StartDate | ||
|} | |} | ||
+ | === Indexes === | ||
+ | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
+ | |- style="background:silver" | ||
+ | | '''Index | ||
+ | | '''Type | ||
+ | | '''Columns | ||
+ | |- valign="top" | ||
+ | | AK_SalesTerritoryHistory_rowguid | ||
+ | | Unique | ||
+ | | rowguid | ||
+ | |} | ||
+ | === Check Constraints === | ||
+ | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
+ | |- style="background:silver" | ||
+ | | '''Check Constraint | ||
+ | | '''Expression | ||
+ | | '''Description | ||
+ | |||
+ | |- valign="top" | ||
+ | | CK_SalesTerritoryHistory_EndDate | ||
+ | | ([EndDate]>=[StartDate] OR [EndDate] IS NULL) | ||
+ | | Check constraint [EndDate] >= [StartDate] OR [EndDate] IS NULL | ||
+ | |} | ||
+ | |||
+ | === Foreign Keys === | ||
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
|- style="background:silver" | |- style="background:silver" | ||
Line 69: | 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 | ||
| TerritoryID | | TerritoryID | ||
|} | |} | ||
+ | |||
+ | === References === | ||
+ | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
+ | |- style="background:silver" | ||
+ | | '''Dependency Type | ||
+ | | '''Object Type | ||
+ | | '''Referenced Object | ||
+ | |||
+ | |- valign="top" | ||
+ | | Schema | ||
+ | | Schema | ||
+ | | [[Sales_(schema)|Sales]] | ||
+ | |||
+ | |} | ||
+ | |||
== automatically generated == | == automatically generated == | ||
Line 86: | Line 131: | ||
| '''Table | | '''Table | ||
| Sales.SalesTerritoryHistory | | Sales.SalesTerritoryHistory | ||
− | |- | + | |- valign="top" |
− | |||
| '''Description | | '''Description | ||
| Sales representative transfers to other sales territories. | | Sales representative transfers to other sales territories. | ||
|- | |- | ||
− | |||
|} | |} | ||
Line 101: | Line 144: | ||
| '''Nullable | | '''Nullable | ||
| '''Default | | '''Default | ||
− | | '''Description | + | | '''Description / PK / Index |
− | |||
− | |- | + | |- valign="top" |
| SalesPersonID | | SalesPersonID | ||
| int | | int | ||
| not null | | not null | ||
| | | | ||
− | | Primary key for SalesTerritoryHistory records. | + | | Primary key for SalesTerritoryHistory records.<br />PK_SalesTerritoryHistory_SalesPersonID_StartDate_TerritoryID |
− | + | |- valign="top" | |
− | |- | ||
| TerritoryID | | TerritoryID | ||
| int | | int | ||
| not null | | not null | ||
| | | | ||
− | | Territory identification number. Foreign key to SalesTerritory.SalesTerritoryID. | + | | Territory identification number. Foreign key to SalesTerritory.SalesTerritoryID.<br />PK_SalesTerritoryHistory_SalesPersonID_StartDate_TerritoryID |
− | + | |- valign="top" | |
− | |- | ||
| StartDate | | StartDate | ||
| datetime | | datetime | ||
| not null | | not null | ||
| | | | ||
− | | Date the sales representive started work in the territory. | + | | Date the sales representive started work in the territory.<br />PK_SalesTerritoryHistory_SalesPersonID_StartDate_TerritoryID |
− | + | |- valign="top" | |
− | |- | ||
| EndDate | | EndDate | ||
| datetime | | datetime | ||
| null | | null | ||
| | | | ||
− | | Date the sales representative left work in the territory. | + | | Date the sales representative left work in the territory.<br /> |
− | + | |- valign="top" | |
− | |- | ||
| rowguid | | rowguid | ||
| uniqueidentifier | | uniqueidentifier | ||
| not null | | not null | ||
| (NEWID()) | | (NEWID()) | ||
− | | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | + | | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.<br />AK_SalesTerritoryHistory_rowguid |
− | + | |- valign="top" | |
− | |- | ||
| ModifiedDate | | ModifiedDate | ||
| datetime | | datetime | ||
| not null | | not null | ||
| (GETDATE()) | | (GETDATE()) | ||
− | | Date and time the record was last updated. | + | | Date and time the record was last updated.<br /> |
− | |||
|} | |} | ||
Line 164: | Line 200: | ||
| TerritoryID | | TerritoryID | ||
| TerritoryID | | TerritoryID | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
+ | |- style="background:silver" | ||
+ | | '''Dependency Type | ||
+ | | '''Object Type | ||
+ | | '''Referenced Object | ||
+ | |||
+ | |- | ||
+ | | Schema | ||
+ | | Schema | ||
+ | | [[Sales_(schema)|Sales]] | ||
+ | |||
|} | |} |
Latest revision as of 23:17, 23 June 2010
Contents
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 |