Difference between revisions of "HumanResources.vEmployeeDepartmentHistory (view)"
(New page: == wikibot == {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" |- | '''view | HumanResources.vEmployeeDepartmentHistory |- |} <pre> CREATE VIEW [HumanResour...) |
|||
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== wikibot == | == wikibot == | ||
+ | |||
+ | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
+ | |- valign="top" | ||
+ | | '''View | ||
+ | | HumanResources.vEmployeeDepartmentHistory | ||
+ | |- valign="top" | ||
+ | | '''Description | ||
+ | | Returns employee name and current and previous departments. | ||
+ | |} | ||
+ | |||
+ | === Source === | ||
+ | <pre> | ||
+ | CREATE VIEW [HumanResources].[vEmployeeDepartmentHistory] | ||
+ | AS | ||
+ | SELECT | ||
+ | e.[EmployeeID] | ||
+ | ,c.[Title] | ||
+ | ,c.[FirstName] | ||
+ | ,c.[MiddleName] | ||
+ | ,c.[LastName] | ||
+ | ,c.[Suffix] | ||
+ | ,s.[Name] AS [Shift] | ||
+ | ,d.[Name] AS [Department] | ||
+ | ,d.[GroupName] | ||
+ | ,edh.[StartDate] | ||
+ | ,edh.[EndDate] | ||
+ | FROM [HumanResources].[Employee] e | ||
+ | INNER JOIN [Person].[Contact] c | ||
+ | ON c.[ContactID] = e.[ContactID] | ||
+ | INNER JOIN [HumanResources].[EmployeeDepartmentHistory] edh | ||
+ | ON e.[EmployeeID] = edh.[EmployeeID] | ||
+ | INNER JOIN [HumanResources].[Department] d | ||
+ | ON edh.[DepartmentID] = d.[DepartmentID] | ||
+ | INNER JOIN [HumanResources].[Shift] s | ||
+ | ON s.[ShiftID] = edh.[ShiftID]; | ||
+ | </pre> | ||
+ | |||
+ | === References === | ||
+ | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
+ | |- style="background:silver" | ||
+ | | '''Dependency Type | ||
+ | | '''Object Type | ||
+ | | '''Referenced Object | ||
+ | |||
+ | |- valign="top" | ||
+ | | Select | ||
+ | | Table | ||
+ | | [[HumanResources.Department_(table)|HumanResources.Department]] | ||
+ | |||
+ | |- valign="top" | ||
+ | | Select | ||
+ | | Table | ||
+ | | [[HumanResources.Employee_(table)|HumanResources.Employee]] | ||
+ | |||
+ | |- valign="top" | ||
+ | | Select | ||
+ | | Table | ||
+ | | [[HumanResources.EmployeeDepartmentHistory_(table)|HumanResources.EmployeeDepartmentHistory]] | ||
+ | |||
+ | |- valign="top" | ||
+ | | Select | ||
+ | | Table | ||
+ | | [[HumanResources.Shift_(table)|HumanResources.Shift]] | ||
+ | |||
+ | |- valign="top" | ||
+ | | Select | ||
+ | | Table | ||
+ | | [[Person.Contact_(table)|Person.Contact]] | ||
+ | |||
+ | |- valign="top" | ||
+ | | Schema | ||
+ | | Schema | ||
+ | | [[HumanResources_(schema)|HumanResources]] | ||
+ | |||
+ | |} | ||
+ | |||
+ | |||
+ | == automatically generated == | ||
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
Line 5: | Line 83: | ||
| '''view | | '''view | ||
| HumanResources.vEmployeeDepartmentHistory | | HumanResources.vEmployeeDepartmentHistory | ||
+ | |- valign="top" | ||
+ | | '''Description | ||
+ | | Returns employee name and current and previous departments. | ||
|- | |- | ||
|} | |} | ||
<pre> | <pre> | ||
+ | |||
CREATE VIEW [HumanResources].[vEmployeeDepartmentHistory] | CREATE VIEW [HumanResources].[vEmployeeDepartmentHistory] | ||
AS | AS | ||
Line 33: | Line 115: | ||
ON s.[ShiftID] = edh.[ShiftID]; | ON s.[ShiftID] = edh.[ShiftID]; | ||
</pre> | </pre> | ||
+ | |||
+ | |||
+ | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
+ | |- style="background:silver" | ||
+ | | '''Dependency Type | ||
+ | | '''Object Type | ||
+ | | '''Referenced Object | ||
+ | |||
+ | |- | ||
+ | | Select | ||
+ | | Table | ||
+ | | [[HumanResources.Department_(table)|HumanResources.Department]] | ||
+ | |||
+ | |- | ||
+ | | Select | ||
+ | | Table | ||
+ | | [[HumanResources.Employee_(table)|HumanResources.Employee]] | ||
+ | |||
+ | |- | ||
+ | | Select | ||
+ | | Table | ||
+ | | [[HumanResources.EmployeeDepartmentHistory_(table)|HumanResources.EmployeeDepartmentHistory]] | ||
+ | |||
+ | |- | ||
+ | | Select | ||
+ | | Table | ||
+ | | [[HumanResources.Shift_(table)|HumanResources.Shift]] | ||
+ | |||
+ | |- | ||
+ | | Select | ||
+ | | Table | ||
+ | | [[Person.Contact_(table)|Person.Contact]] | ||
+ | |||
+ | |- | ||
+ | | Schema | ||
+ | | Schema | ||
+ | | [[HumanResources_(schema)|HumanResources]] | ||
+ | |||
+ | |} |
Latest revision as of 23:16, 23 June 2010
wikibot[edit]
View | HumanResources.vEmployeeDepartmentHistory |
Description | Returns employee name and current and previous departments. |
Source[edit]
CREATE VIEW [HumanResources].[vEmployeeDepartmentHistory] AS SELECT e.[EmployeeID] ,c.[Title] ,c.[FirstName] ,c.[MiddleName] ,c.[LastName] ,c.[Suffix] ,s.[Name] AS [Shift] ,d.[Name] AS [Department] ,d.[GroupName] ,edh.[StartDate] ,edh.[EndDate] FROM [HumanResources].[Employee] e INNER JOIN [Person].[Contact] c ON c.[ContactID] = e.[ContactID] INNER JOIN [HumanResources].[EmployeeDepartmentHistory] edh ON e.[EmployeeID] = edh.[EmployeeID] INNER JOIN [HumanResources].[Department] d ON edh.[DepartmentID] = d.[DepartmentID] INNER JOIN [HumanResources].[Shift] s ON s.[ShiftID] = edh.[ShiftID];
References[edit]
Dependency Type | Object Type | Referenced Object |
Select | Table | HumanResources.Department |
Select | Table | HumanResources.Employee |
Select | Table | HumanResources.EmployeeDepartmentHistory |
Select | Table | HumanResources.Shift |
Select | Table | Person.Contact |
Schema | Schema | HumanResources |
automatically generated[edit]
view | HumanResources.vEmployeeDepartmentHistory |
Description | Returns employee name and current and previous departments. |
CREATE VIEW [HumanResources].[vEmployeeDepartmentHistory] AS SELECT e.[EmployeeID] ,c.[Title] ,c.[FirstName] ,c.[MiddleName] ,c.[LastName] ,c.[Suffix] ,s.[Name] AS [Shift] ,d.[Name] AS [Department] ,d.[GroupName] ,edh.[StartDate] ,edh.[EndDate] FROM [HumanResources].[Employee] e INNER JOIN [Person].[Contact] c ON c.[ContactID] = e.[ContactID] INNER JOIN [HumanResources].[EmployeeDepartmentHistory] edh ON e.[EmployeeID] = edh.[EmployeeID] INNER JOIN [HumanResources].[Department] d ON edh.[DepartmentID] = d.[DepartmentID] INNER JOIN [HumanResources].[Shift] s ON s.[ShiftID] = edh.[ShiftID];
Dependency Type | Object Type | Referenced Object |
Select | Table | HumanResources.Department |
Select | Table | HumanResources.Employee |
Select | Table | HumanResources.EmployeeDepartmentHistory |
Select | Table | HumanResources.Shift |
Select | Table | Person.Contact |
Schema | Schema | HumanResources |