HumanResources.EmployeeDepartmentHistory Table

Information

NameEmployeeDepartmentHistory
SchemaHumanResources
Row Count0
Data Size 
Index Size 
Reserved Size 
Unused Size 
Created29.3.2010. 21:58:18
Modified29.3.2010. 21:58:54

Extended Properties

NameTypeProperty NameValue
EmployeeDepartmentHistoryTABLEMS_DescriptionEmployee department transfers.

Columns

PKKeyIdentityNameData TypeAllow NullsCollationReferencesDefaultComputedCompute Expression
   EmployeeIDint  HumanResources.Employee.EmployeeID
 
 
 
   DepartmentIDsmallint  HumanResources.Department.DepartmentID
 
 
 
   ShiftIDtinyint  HumanResources.Shift.ShiftID
 
 
 
   StartDatedatetime   
 
 
 
   EndDatedatetime   
 
 
 
   ModifiedDatedatetime   
(getdate())
 
 

Indexes

NameTypePrimaryUniqueColumns
PK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentIDClustered  EmployeeID, StartDate, DepartmentID, ShiftID
IX_EmployeeDepartmentHistory_DepartmentIDNonClustered  DepartmentID
IX_EmployeeDepartmentHistory_ShiftIDNonClustered  ShiftID

Check Constraints

NameColumnEnabledTrustedExpression
CK_EmployeeDepartmentHistory_EndDate   ([EndDate]>=[StartDate] OR [EndDate] IS NULL)

Foreign Key Constraints

NameTypeReferenced Table
FK_EmployeeDepartmentHistory_Department_DepartmentIDForeign keyHumanResources.Department
FK_EmployeeDepartmentHistory_Employee_EmployeeIDForeign keyHumanResources.Employee
FK_EmployeeDepartmentHistory_Shift_ShiftIDForeign keyHumanResources.Shift

SQL Script

CREATE TABLE [HumanResources].[EmployeeDepartmentHistory] (
    [EmployeeID] int NOT NULL,
    [DepartmentID] smallint NOT NULL,
    [ShiftID] tinyint NOT NULL,
    [StartDate] datetime NOT NULL,
    [EndDate] datetime NULL,
    [ModifiedDate] datetime NOT NULL DEFAULT (getdate())
);
CREATE INDEX [IX_EmployeeDepartmentHistory_DepartmentID] on [HumanResources].[EmployeeDepartmentHistory]([DepartmentID]);
CREATE INDEX [IX_EmployeeDepartmentHistory_ShiftID] on [HumanResources].[EmployeeDepartmentHistory]([ShiftID]);