AdventureWorks2019
Sales.SalesTerritoryHistory
//
Sales representative transfers to other sales territories.
Created: Modified:
Columns
-
//${escapify(column.description)}[int] NOT NULL
-
//${escapify(column.description)}[int] NOT NULL
-
//${escapify(column.description)}[datetime] NOT NULL
-
//${escapify(column.description)}[datetime] NULL
-
//${escapify(column.description)}[uniqueidentifier] NOT NULL DEFAULT (newid())
-
//${escapify(column.description)}[datetime] NOT NULL DEFAULT (getdate())
Indexes
-
//Clustered index created by a primary key constraint.PK_SalesTerritoryHistory_BusinessEntityID_StartDate_TerritoryIDUNIQUE CLUSTEREDBusinessEntityID , TerritoryID , StartDate
-
//Unique nonclustered index. Used to support replication samples.AK_SalesTerritoryHistory_rowguidUNIQUE NONCLUSTEREDrowguid
Foreign Keys
-
//Foreign key constraint referencing SalesPerson.SalesPersonID.FK_SalesTerritoryHistory_SalesPerson_BusinessEntityIDSales.SalesPersonBusinessEntityID ⥱ BusinessEntityID
-
//Foreign key constraint referencing SalesTerritory.TerritoryID.FK_SalesTerritoryHistory_SalesTerritory_TerritoryIDSales.SalesTerritoryTerritoryID ⥱ TerritoryID
Check Constraints
-
//Check constraint [EndDate] >= [StartDate] OR [EndDate] IS NULLCK_SalesTerritoryHistory_EndDate([EndDate]>=[StartDate] OR [EndDate] IS NULL)
Sample Data
BusinessEntityID
TerritoryID
StartDate
EndDate
rowguid
ModifiedDate
275
2
8563CE6A-00FF-47D7-BA4D-3C3E1CDEF531
275
3
NULL
2F44304C-EE87-4C72-813E-CA75C5F61F4C
276
4
NULL
64BCB1B3-A793-40BA-9859-D90F78C3F167
277
3
3E9F893D-5142-46C9-A76A-867D1E3D6F90
277
2
NULL
132E4721-32DD-4A73-B556-1837F3A2B9AE
278
6
NULL
B7C8F9F5-5FB8-47B3-BE73-1B9A14BDF8B9
279
5
NULL
57D1CDCF-62CE-499F-8BE8-1BB71C4BB7EF
280
1
FD3F5566-10E2-4960-BE12-0365E5665881
281
4
NULL
9D8754B2-C320-40DB-A77F-FF5A1BC0F46B
282
6
2C9F5240-D8BF-4F85-897D-6083146DBC4B
282
10
NULL
92375465-38C6-4C86-ABA1-9838A2969475
283
1
NULL
009F7660-44A6-4ADF-BD4B-A5D1B79993F5
284
1
NULL
ED12F921-8023-48EF-84BD-94D942F4C009
286
9
NULL
D664D989-2BEB-4F2C-A4AA-691018965283
288
8
NULL
3E1360CB-32E0-4286-8D98-8539F1AB2550
289
6
NULL
987613ED-33D6-42A6-B992-0B33E9234934
290
7
NULL
8895E74D-6D38-4140-BBEA-A8136A2F480E