ScrewTurn Wiki

Edit

wikibot

TableHumanResources.EmployeeDepartmentHistory
DescriptionEmployee department transfers.

Edit

Columns

ColumnData TypeNullableDefaultDescription
EmployeeIDintnot null Employee identification number. Foreign key to Employee.EmployeeID.
DepartmentIDsmallintnot null Department in which the employee worked including currently. Foreign key to Department.DepartmentID.
ShiftIDtinyintnot null Identifies which 8-hour shift the employee works. Foreign key to Shift.Shift.ID.
StartDatedatetimenot null Date the employee started work in the department.
EndDatedatetimenull Date the employee left the department. NULL = Current department.
ModifiedDatedatetimenot null(getdate())Date and time the record was last updated.

Edit

Primary Key

Primary KeyColumns
PK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentIDEmployeeID, DepartmentID, ShiftID, StartDate

Edit

Indexes

IndexTypeColumns
IX_EmployeeDepartmentHistory_DepartmentID DepartmentID
IX_EmployeeDepartmentHistory_ShiftID ShiftID

Edit

Check Constraints

Check ConstraintExpressionDescription
CK_EmployeeDepartmentHistory_EndDate(EndDate>=StartDate OR EndDate IS NULL)Check constraint EndDate >= StartDate OR EndDate IS NUL

Edit

Foreign Keys

RelationColumnReferenced Column
HumanResources.DepartmentDepartmentIDDepartmentID
HumanResources.EmployeeEmployeeIDEmployeeID
HumanResources.ShiftShiftIDShiftID

Edit

References

Dependency TypeObject TypeReferenced Object
SchemaSchemaHumanResources

Edit

Dependencies

Reference TypeObject TypeReferencing Object
SelectViewHumanResources.vEmployeeDepartment
SelectViewHumanResources.vEmployeeDepartmentHistory

Edit

automatically generated

TableHumanResources.EmployeeDepartmentHistory
DescriptionEmployee department transfers.

ColumnData TypeNullableDefaultDescription / PK / Index
EmployeeIDintnot null Employee identification number. Foreign key to Employee.EmployeeID.
PK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentID
DepartmentIDsmallintnot null Department in which the employee worked including currently. Foreign key to Department.DepartmentID.
PK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentIDIX_EmployeeDepartmentHistory_DepartmentID
ShiftIDtinyintnot null Identifies which 8-hour shift the employee works. Foreign key to Shift.Shift.ID.
PK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentIDIX_EmployeeDepartmentHistory_ShiftID
StartDatedatetimenot null Date the employee started work in the department.
PK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentID
EndDatedatetimenull Date the employee left the department. NULL = Current department.
ModifiedDatedatetimenot null(GETDATE())Date and time the record was last updated.



RelationColumnReferenced Column
HumanResources.DepartmentDepartmentIDDepartmentID
HumanResources.EmployeeEmployeeIDEmployeeID
HumanResources.ShiftShiftIDShiftID

Dependency TypeObject TypeReferenced Object
SchemaSchemaHumanResources

Reference TypeObject TypeReferencing Object
SelectViewHumanResources.vEmployeeDepartment
SelectViewHumanResources.vEmployeeDepartmentHistory

ScrewTurn Wiki version 2.0.36. Some of the icons created by FamFamFam.