Difference between revisions of "HumanResources.EmployeeDepartmentHistory (table)"
(10 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
− | |- | + | |- valign="top" |
| '''Table | | '''Table | ||
| HumanResources.EmployeeDepartmentHistory | | HumanResources.EmployeeDepartmentHistory | ||
− | |- | + | |- valign="top" |
+ | | '''Description | ||
+ | | Employee department transfers. | ||
|} | |} | ||
− | + | === Columns === | |
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
|- style="background:silver" | |- style="background:silver" | ||
Line 15: | Line 17: | ||
| '''Nullable | | '''Nullable | ||
| '''Default | | '''Default | ||
− | | ''' | + | | '''Description |
− | + | ||
− | + | |- valign="top" | |
− | |- | ||
| EmployeeID | | EmployeeID | ||
| int | | int | ||
| not null | | not null | ||
| | | | ||
− | | | + | | Employee identification number. Foreign key to Employee.EmployeeID. |
− | + | |- valign="top" | |
− | |- | ||
| DepartmentID | | DepartmentID | ||
| smallint | | smallint | ||
| not null | | not null | ||
| | | | ||
− | | | + | | Department in which the employee worked including currently. Foreign key to Department.DepartmentID. |
− | + | |- valign="top" | |
− | |- | ||
| ShiftID | | ShiftID | ||
| tinyint | | tinyint | ||
| not null | | not null | ||
| | | | ||
− | | | + | | Identifies which 8-hour shift the employee works. Foreign key to Shift.Shift.ID. |
− | + | |- valign="top" | |
− | |- | ||
| StartDate | | StartDate | ||
| datetime | | datetime | ||
| not null | | not null | ||
| | | | ||
− | | | + | | Date the employee started work in the department. |
− | + | |- valign="top" | |
− | |- | ||
| EndDate | | EndDate | ||
| datetime | | datetime | ||
| null | | null | ||
| | | | ||
− | | | + | | Date the employee left the department. NULL = Current department. |
− | + | |- valign="top" | |
− | |- | ||
| ModifiedDate | | ModifiedDate | ||
| datetime | | datetime | ||
| not null | | not null | ||
| (getdate()) | | (getdate()) | ||
+ | | Date and time the record was last updated. | ||
+ | |} | ||
+ | |||
+ | === Primary Key === | ||
+ | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
+ | |- style="background:silver" | ||
+ | | '''Primary Key | ||
+ | | '''Columns | ||
+ | |- valign="top" | ||
+ | | PK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentID | ||
+ | | EmployeeID, DepartmentID, ShiftID, StartDate | ||
+ | |} | ||
+ | |||
+ | === Indexes === | ||
+ | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
+ | |- style="background:silver" | ||
+ | | '''Index | ||
+ | | '''Type | ||
+ | | '''Columns | ||
+ | |||
+ | |- valign="top" | ||
+ | | IX_EmployeeDepartmentHistory_DepartmentID | ||
| | | | ||
+ | | DepartmentID | ||
+ | |- valign="top" | ||
+ | | IX_EmployeeDepartmentHistory_ShiftID | ||
| | | | ||
+ | | ShiftID | ||
|} | |} | ||
+ | === Check Constraints === | ||
+ | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
+ | |- style="background:silver" | ||
+ | | '''Check Constraint | ||
+ | | '''Expression | ||
+ | | '''Description | ||
+ | |- valign="top" | ||
+ | | CK_EmployeeDepartmentHistory_EndDate | ||
+ | | ([EndDate]>=[StartDate] OR [EndDate] IS NULL) | ||
+ | | Check constraint [EndDate] >= [StartDate] OR [EndDate] IS NUL | ||
+ | |} | ||
+ | === Foreign Keys === | ||
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
|- style="background:silver" | |- style="background:silver" | ||
Line 69: | Line 103: | ||
| '''Column | | '''Column | ||
| '''Referenced Column | | '''Referenced Column | ||
− | + | ||
− | |- | + | |- valign="top" |
| [[HumanResources.Department_(table)|HumanResources.Department]] | | [[HumanResources.Department_(table)|HumanResources.Department]] | ||
| DepartmentID | | DepartmentID | ||
| DepartmentID | | DepartmentID | ||
− | |- | + | |- valign="top" |
| [[HumanResources.Employee_(table)|HumanResources.Employee]] | | [[HumanResources.Employee_(table)|HumanResources.Employee]] | ||
| EmployeeID | | EmployeeID | ||
| EmployeeID | | EmployeeID | ||
− | |- | + | |- valign="top" |
| [[HumanResources.Shift_(table)|HumanResources.Shift]] | | [[HumanResources.Shift_(table)|HumanResources.Shift]] | ||
| ShiftID | | ShiftID | ||
| ShiftID | | ShiftID | ||
|} | |} | ||
+ | |||
+ | === References === | ||
+ | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
+ | |- style="background:silver" | ||
+ | | '''Dependency Type | ||
+ | | '''Object Type | ||
+ | | '''Referenced Object | ||
+ | |||
+ | |- valign="top" | ||
+ | | Schema | ||
+ | | Schema | ||
+ | | [[HumanResources_(schema)|HumanResources]] | ||
+ | |||
+ | |} | ||
+ | |||
+ | === Dependencies === | ||
+ | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
+ | |- style="background:silver" | ||
+ | | '''Reference Type | ||
+ | | '''Object Type | ||
+ | | '''Referencing Object | ||
+ | |||
+ | |- valign="top" | ||
+ | | Select | ||
+ | | View | ||
+ | | [[HumanResources.vEmployeeDepartment_(view)|HumanResources.vEmployeeDepartment]] | ||
+ | |||
+ | |- valign="top" | ||
+ | | Select | ||
+ | | View | ||
+ | | [[HumanResources.vEmployeeDepartmentHistory_(view)|HumanResources.vEmployeeDepartmentHistory]] | ||
+ | |||
+ | |} | ||
+ | |||
+ | |||
== automatically generated == | == automatically generated == | ||
Line 89: | Line 158: | ||
| '''Table | | '''Table | ||
| HumanResources.EmployeeDepartmentHistory | | HumanResources.EmployeeDepartmentHistory | ||
− | |- | + | |- valign="top" |
− | |||
| '''Description | | '''Description | ||
| Employee department transfers. | | Employee department transfers. | ||
|- | |- | ||
− | |||
|} | |} | ||
Line 111: | Line 178: | ||
| not null | | not null | ||
| | | | ||
− | | Employee identification number. Foreign key to Employee.EmployeeID.PK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentID | + | | Employee identification number. Foreign key to Employee.EmployeeID.<br />PK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentID |
|- valign="top" | |- valign="top" | ||
| DepartmentID | | DepartmentID | ||
Line 117: | Line 184: | ||
| not null | | not null | ||
| | | | ||
− | | Department in which the employee worked including currently. Foreign key to Department.DepartmentID.PK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentIDIX_EmployeeDepartmentHistory_DepartmentID | + | | Department in which the employee worked including currently. Foreign key to Department.DepartmentID.<br />PK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentIDIX_EmployeeDepartmentHistory_DepartmentID |
|- valign="top" | |- valign="top" | ||
| ShiftID | | ShiftID | ||
Line 123: | Line 190: | ||
| not null | | not null | ||
| | | | ||
− | | Identifies which 8-hour shift the employee works. Foreign key to Shift.Shift.ID.PK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentIDIX_EmployeeDepartmentHistory_ShiftID | + | | Identifies which 8-hour shift the employee works. Foreign key to Shift.Shift.ID.<br />PK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentIDIX_EmployeeDepartmentHistory_ShiftID |
|- valign="top" | |- valign="top" | ||
| StartDate | | StartDate | ||
Line 129: | Line 196: | ||
| not null | | not null | ||
| | | | ||
− | | Date the employee started work in the department.PK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentID | + | | Date the employee started work in the department.<br />PK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentID |
|- valign="top" | |- valign="top" | ||
| EndDate | | EndDate | ||
Line 135: | Line 202: | ||
| null | | null | ||
| | | | ||
− | | Date the employee left the department. NULL = Current department. | + | | Date the employee left the department. NULL = Current department.<br /> |
|- valign="top" | |- valign="top" | ||
| ModifiedDate | | ModifiedDate | ||
Line 141: | Line 208: | ||
| not null | | not null | ||
| (GETDATE()) | | (GETDATE()) | ||
− | | Date and time the record was last updated. | + | | Date and time the record was last updated.<br /> |
|} | |} | ||
Line 169: | Line 236: | ||
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
|- style="background:silver" | |- style="background:silver" | ||
− | | ''' | + | | '''Dependency Type |
| '''Object Type | | '''Object Type | ||
+ | | '''Referenced Object | ||
+ | |||
+ | |- | ||
+ | | Schema | ||
+ | | Schema | ||
+ | | [[HumanResources_(schema)|HumanResources]] | ||
+ | |||
+ | |} | ||
+ | |||
+ | |||
+ | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
+ | |- style="background:silver" | ||
| '''Reference Type | | '''Reference Type | ||
− | + | | '''Object Type | |
+ | | '''Referencing Object | ||
+ | |||
|- | |- | ||
+ | | Select | ||
+ | | View | ||
| [[HumanResources.vEmployeeDepartment_(view)|HumanResources.vEmployeeDepartment]] | | [[HumanResources.vEmployeeDepartment_(view)|HumanResources.vEmployeeDepartment]] | ||
+ | |||
+ | |- | ||
+ | | Select | ||
| View | | View | ||
− | |||
− | |||
| [[HumanResources.vEmployeeDepartmentHistory_(view)|HumanResources.vEmployeeDepartmentHistory]] | | [[HumanResources.vEmployeeDepartmentHistory_(view)|HumanResources.vEmployeeDepartmentHistory]] | ||
− | + | ||
− | |||
|} | |} |
Latest revision as of 23:15, 23 June 2010
Contents
[hide]wikibot[edit]
Table | HumanResources.EmployeeDepartmentHistory |
Description | Employee department transfers. |
Columns[edit]
Column | Data Type | Nullable | Default | Description |
EmployeeID | int | not null | Employee identification number. Foreign key to Employee.EmployeeID. | |
DepartmentID | smallint | not null | Department in which the employee worked including currently. Foreign key to Department.DepartmentID. | |
ShiftID | tinyint | not null | Identifies which 8-hour shift the employee works. Foreign key to Shift.Shift.ID. | |
StartDate | datetime | not null | Date the employee started work in the department. | |
EndDate | datetime | null | Date the employee left the department. NULL = Current department. | |
ModifiedDate | datetime | not null | (getdate()) | Date and time the record was last updated. |
Primary Key[edit]
Primary Key | Columns |
PK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentID | EmployeeID, DepartmentID, ShiftID, StartDate |
Indexes[edit]
Index | Type | Columns |
IX_EmployeeDepartmentHistory_DepartmentID | DepartmentID | |
IX_EmployeeDepartmentHistory_ShiftID | ShiftID |
Check Constraints[edit]
Check Constraint | Expression | Description |
CK_EmployeeDepartmentHistory_EndDate | ([EndDate]>=[StartDate] OR [EndDate] IS NULL) | Check constraint [EndDate] >= [StartDate] OR [EndDate] IS NUL |
Foreign Keys[edit]
Relation | Column | Referenced Column |
HumanResources.Department | DepartmentID | DepartmentID |
HumanResources.Employee | EmployeeID | EmployeeID |
HumanResources.Shift | ShiftID | ShiftID |
References[edit]
Dependency Type | Object Type | Referenced Object |
Schema | Schema | HumanResources |
Dependencies[edit]
Reference Type | Object Type | Referencing Object |
Select | View | HumanResources.vEmployeeDepartment |
Select | View | HumanResources.vEmployeeDepartmentHistory |
automatically generated[edit]
Table | HumanResources.EmployeeDepartmentHistory |
Description | Employee department transfers. |
Column | Data Type | Nullable | Default | Description / PK / Index |
EmployeeID | int | not null | Employee identification number. Foreign key to Employee.EmployeeID. PK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentID | |
DepartmentID | smallint | not null | Department in which the employee worked including currently. Foreign key to Department.DepartmentID. PK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentIDIX_EmployeeDepartmentHistory_DepartmentID | |
ShiftID | tinyint | not null | Identifies which 8-hour shift the employee works. Foreign key to Shift.Shift.ID. PK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentIDIX_EmployeeDepartmentHistory_ShiftID | |
StartDate | datetime | not null | Date the employee started work in the department. PK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentID | |
EndDate | datetime | null | Date the employee left the department. NULL = Current department. | |
ModifiedDate | datetime | not null | (GETDATE()) | Date and time the record was last updated. |
Relation | Column | Referenced Column |
HumanResources.Department | DepartmentID | DepartmentID |
HumanResources.Employee | EmployeeID | EmployeeID |
HumanResources.Shift | ShiftID | ShiftID |
Dependency Type | Object Type | Referenced Object |
Schema | Schema | HumanResources |
Reference Type | Object Type | Referencing Object |
Select | View | HumanResources.vEmployeeDepartment |
Select | View | HumanResources.vEmployeeDepartmentHistory |