From dbscript Online Help
wikibot
| Table
|
Sales.SalesTerritoryHistory
|
| Description
|
Sales representative transfers to other sales territories.
|
Columns
| 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
| Primary Key
|
Columns
|
| PK_SalesTerritoryHistory_SalesPersonID_StartDate_TerritoryID
|
SalesPersonID, TerritoryID, StartDate
|
Indexes
| Index
|
Type
|
Columns
|
| AK_SalesTerritoryHistory_rowguid
|
Unique
|
rowguid
|
Check Constraints
| Check Constraint
|
Expression
|
Description
|
| CK_SalesTerritoryHistory_EndDate
|
([EndDate]>=[StartDate] OR [EndDate] IS NULL)
|
Check constraint [EndDate] >= [StartDate] OR [EndDate] IS NULL
|
Foreign Keys
References
| Dependency Type
|
Object Type
|
Referenced Object
|
| Schema
|
Schema
|
Sales
|
automatically generated
| 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.
|
| Dependency Type
|
Object Type
|
Referenced Object
|
| Schema
|
Schema
|
Sales
|