Tables | SQL 2005 Adventure Works OLTP |
Sales representative transfers to other sales territories.
Columns
Name Data type Nullable Description SalesPersonID int No Primary key for SalesTerritoryHistory records. TerritoryID int No Territory identification number. Foreign key to SalesTerritory.SalesTerritoryID. StartDate datetime No Date the sales representive started work in the territory. EndDate datetime Yes Date the sales representative left work in the territory. rowguid uniqueidentifier No Default value: NEWID()
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.ModifiedDate datetime No Default value: GETDATE()
Date and time the record was last updated.
Constraints
Name Type Columns Description DF_SalesTerritoryHistory_rowguid DEFAULT rowguid Value: NEWID()
Default constraint value of NEWID()DF_SalesTerritoryHistory_ModifiedDate DEFAULT ModifiedDate Value: GETDATE()
Default constraint value of GETDATE()CK_SalesTerritoryHistory_EndDate CHECK N/A Value: (([EndDate] >= [StartDate]) OR ([EndDate] IS NULL) )
Check constraint [EndDate] >= [StartDate] OR [EndDate] IS NULLPK_SalesTerritoryHistory_SalesPersonID_StartDate_TerritoryID PRIMARY KEY SalesPersonID
StartDate
TerritoryIDClustered index created by a primary key constraint. FK_SalesTerritoryHistory_SalesPerson_SalesPersonID FOREIGN KEY SalesPersonID Reference table: Sales.SalesPerson
Foreign key constraint referencing SalesPerson.SalesPersonID.FK_SalesTerritoryHistory_SalesTerritory_TerritoryID FOREIGN KEY TerritoryID Reference table: Sales.SalesTerritory
Foreign key constraint referencing SalesTerritory.TerritoryID.
Indices
Name Description AK_SalesTerritoryHistory_rowguid Unique nonclustered index.Used to support replication samples.
Triggers
Name Description Sales.uSalesTerritoryHistory AFTER UPDATE trigger setting the ModifiedDate column in the SalesTerritoryHistory table to the current date.
Modified by
Name Description Sales.uSalesTerritoryHistory AFTER UPDATE trigger setting the ModifiedDate column in the SalesTerritoryHistory table to the current date.
Applies to
Tables | User