Northwind Database (Document! X Sample)
HumanResources.vEmployeeDepartment View
AdventureWorks Database > HumanResources Schema : HumanResources.vEmployeeDepartment View
Description
Returns employee name, title, and current department.
Properties
Creation Date27/10/2017 14:33
Is Schema Bound
Encrypted
Ansi Nulls
Columns
 Column NameDescriptionDatatypeLengthAllow NullsDefaultFormula
  Integer4   
  VarWChar8  
  dbo.Name50   
  dbo.Name50  
  dbo.Name50   
  VarWChar10  
  VarWChar50   
  dbo.Name50   
  dbo.Name50   
  DBDate8   
Objects that HumanResources.vEmployeeDepartment depends on
 Database ObjectObject TypeDescriptionDep Level
Person.BusinessEntity tablePerson.BusinessEntityTableSource of the ID that connects vendors, customers, and employees with address and contact information.2
HumanResources.Department tableHumanResources.DepartmentTableLookup table containing the departments within the Adventure Works Cycles company.1
HumanResources.Employee tableHumanResources.EmployeeTableEmployee information such as salary, department, and title.1
HumanResources.EmployeeDepartmentHistory tableHumanResources.EmployeeDepartmentHistoryTableEmployee department transfers.1
dbo.Flag datatypedbo.FlagUser Defined Data Type 2
dbo.NameStyle datatypedbo.NameStyleUser Defined Data Type 2
Person.Person tablePerson.PersonTableHuman beings involved with AdventureWorks: employees, customer contacts, and vendor contacts.1
HumanResources.Shift tableHumanResources.ShiftTableWork shift lookup table.2
View Definition
CREATE VIEW [HumanResources].[vEmployeeDepartment] 
AS 

SELECT 
    e.[BusinessEntityID] 
    ,p.[Title] 
    ,p.[FirstName] 
    ,p.[MiddleName] 
    ,p.[LastName] 
    ,p.[Suffix] 
    ,e.[JobTitle]
    ,d.[Name] AS [Department] 
    ,d.[GroupName] 
    ,edh.[StartDate] 
FROM [HumanResources].[Employee] e
    INNER JOIN [Person].[Person] p
    ON p.[BusinessEntityID] = e.[BusinessEntityID]
    INNER JOIN [HumanResources].[EmployeeDepartmentHistory] edh 
    ON e.[BusinessEntityID] = edh.[BusinessEntityID] 
    INNER JOIN [HumanResources].[Department] d 
    ON edh.[DepartmentID] = d.[DepartmentID] 
WHERE edh.EndDate IS NULL
See Also

Related Objects

HumanResources Schema
AdventureWorks Database