Difference between revisions of "HumanResources.vEmployee (view)"

From dbscript Online Help
Jump to: navigation, search
 
Line 55: Line 55:
 
| Select
 
| Select
 
| Table
 
| Table
| [[HumanResources.Employee_(_(table))|HumanResources.Employee]]
+
| [[HumanResources.Employee_(table)|HumanResources.Employee]]
  
 
|- valign="top"
 
|- valign="top"
 
| Select
 
| Select
 
| Table
 
| Table
| [[HumanResources.EmployeeAddress_(_(table))|HumanResources.EmployeeAddress]]
+
| [[HumanResources.EmployeeAddress_(table)|HumanResources.EmployeeAddress]]
  
 
|- valign="top"
 
|- valign="top"
 
| Select
 
| Select
 
| Table
 
| Table
| [[Person.Address_(_(table))|Person.Address]]
+
| [[Person.Address_(table)|Person.Address]]
  
 
|- valign="top"
 
|- valign="top"
 
| Select
 
| Select
 
| Table
 
| Table
| [[Person.Contact_(_(table))|Person.Contact]]
+
| [[Person.Contact_(table)|Person.Contact]]
  
 
|- valign="top"
 
|- valign="top"
 
| Select
 
| Select
 
| Table
 
| Table
| [[Person.CountryRegion_(_(table))|Person.CountryRegion]]
+
| [[Person.CountryRegion_(table)|Person.CountryRegion]]
  
 
|- valign="top"
 
|- valign="top"
 
| Select
 
| Select
 
| Table
 
| Table
| [[Person.StateProvince_(_(table))|Person.StateProvince]]
+
| [[Person.StateProvince_(table)|Person.StateProvince]]
  
 
|- valign="top"
 
|- valign="top"
 
| Schema
 
| Schema
 
| Schema
 
| Schema
| [[HumanResources_(_(schema))|HumanResources]]
+
| [[HumanResources_(schema)|HumanResources]]
  
 
|}
 
|}

Latest revision as of 00:16, 24 June 2010

wikibot[edit]

View HumanResources.vEmployee
Description Employee names and addresses.

Source[edit]

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];

References[edit]

Dependency Type Object Type Referenced Object
Select Table HumanResources.Employee
Select Table HumanResources.EmployeeAddress
Select Table Person.Address
Select Table Person.Contact
Select Table Person.CountryRegion
Select Table Person.StateProvince
Schema Schema HumanResources


automatically generated[edit]

view HumanResources.vEmployee
Description Employee names and addresses.

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];


Dependency Type Object Type Referenced Object
Select Table HumanResources.Employee
Select Table HumanResources.EmployeeAddress
Select Table Person.Address
Select Table Person.Contact
Select Table Person.CountryRegion
Select Table Person.StateProvince
Schema Schema HumanResources