view icon View: vEmployeeDepartment

Properties

Property Value
Name vEmployeeDepartment
ID 1819153526
Schema HumanResources
Owner dbo
Encrypted false
Schema Bound false
With Check Option false
ANSI NULLS true
Uses Quoted Identifier true
Has Opaque Metadata false
Published false
Schema Published false
Replicated false
Has Replication Filter false
Has Unchecked Assembly Data false
Date Correlation View false
Uses Database Collation false
Tracked by CDC false
MS Shipped false
Modify Date 8/8/2010 5:23:45 PM
Create Date 8/8/2010 5:23:45 PM

Extended Properties

Name Value
MS_Description Returns employee name, title, and current department.

View Columns

Column Name Datatype Nullable Is Identity
BusinessEntityID int false false
Title nvarchar(8) true false
FirstName Name false false
MiddleName Name true false
LastName Name false false
Suffix nvarchar(10) true false
JobTitle nvarchar(50) false false
Department Name false false
GroupName Name false false
StartDate date false false

Indexes

No view indexes defined.

Object Level Permissions

No object level permissions defined.

Column Level Permissions

No explicit column permissions granted to this object

Objects that depend on [vEmployeeDepartment]

Objects on which [vEmployeeDepartment] depends

SQL

Script
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
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 GETDATE() BETWEEN edh.[StartDate] AND ISNULL(edh.[EndDate], GETDATE());
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Returns employee name, title, and current department.' , @level0type=N'SCHEMA',@level0name=N'HumanResources', @level1type=N'VIEW',@level1name=N'vEmployeeDepartment'

See also

List of Views