AdventureWorks
HumanResources.vEmployee View
Description
Employee names and addresses.
Properties
Creation Date08/01/2010 08:41
Is Schema Bound
Encrypted
Ansi Nulls
Columns
 Column NameDescriptionDatatypeLengthAllow NullsDefaultFormula
 EmployeeID int4   
 Title nvarchar8  
 FirstName dbo.Name50   
 MiddleName dbo.Name50  
 LastName dbo.Name50   
 Suffix nvarchar10  
 JobTitle nvarchar50   
 Phone dbo.Phone25  
 EmailAddress nvarchar50  
 EmailPromotion int4   
 AddressLine1 nvarchar60   
 AddressLine2 nvarchar60  
 City nvarchar30   
 StateProvinceName dbo.Name50   
 PostalCode nvarchar15   
 CountryRegionName dbo.Name50   
 AdditionalContactInfo Person.AdditionalContactInfoSchemaCollection16  
Objects that HumanResources.vEmployee depends on
 Database ObjectObject TypeDescriptionDep Level
Person.Address tablePerson.AddressTableStreet address information for customers, employees, and vendors.1
Person.Contact tablePerson.ContactTableNames of each employee, customer contact, and vendor contact.1
Person.CountryRegion tablePerson.CountryRegionTableLookup table containing the ISO standard codes for countries and regions.1
HumanResources.Employee tableHumanResources.EmployeeTableEmployee information such as salary, department, and title.1
HumanResources.EmployeeAddress tableHumanResources.EmployeeAddressTableCross-reference table mapping employees to their address(es).1
dbo.Flag datatypedbo.FlagUser Defined Data Type 2
dbo.Name datatypedbo.NameUser Defined Data Type 2
dbo.NameStyle datatypedbo.NameStyleUser Defined Data Type 2
dbo.Phone datatypedbo.PhoneUser Defined Data Type 2
Sales.SalesTerritory tableSales.SalesTerritoryTableSales territory lookup table.2
Person.StateProvince tablePerson.StateProvinceTableState and province lookup table.1
View Definition
CREATE VIEW [HumanResources].[vEmployee] 
AS 

SELECT 
e.[EmployeeID]
,c.[Title]
,c.[FirstName]
,c.[MiddleName]
,c.[LastName]
,c.[Suffix]
,e.[Title] AS [JobTitle] 
,c.[Phone]
,c.[EmailAddress]
,c.[EmailPromotion]
,a.[AddressLine1]
,a.[AddressLine2]
,a.[City]
,sp.[Name] AS [StateProvinceName] 
,a.[PostalCode]
,cr.[Name] AS [CountryRegionName] 
,c.[AdditionalContactInfo]
FROM [HumanResources].[Employee] e
INNER JOIN [Person].[Contact] c 
ON c.[ContactID] = e.[ContactID]
INNER JOIN [HumanResources].[EmployeeAddress] ea 
ON e.[EmployeeID] = ea.[EmployeeID] 
INNER JOIN [Person].[Address] a 
ON ea.[AddressID] = a.[AddressID]
INNER JOIN [Person].[StateProvince] sp 
ON sp.[StateProvinceID] = a.[StateProvinceID]
INNER JOIN [Person].[CountryRegion] cr 
ON cr.[CountryRegionCode] = sp.[CountryRegionCode];
See Also

Related Objects

HumanResources Schema
AdventureWorks Database

 

 


© 2012 All Rights Reserved.

Send comments on this topic.