<?xml version="1.0" encoding="utf-8"?>
<html>
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=8" />
    <link rel="stylesheet" href="../../../css/main.css" type="text/css" />
    <link rel="stylesheet" href="../../../css/jquery.treeview.css" />
    <script src="../../../script/jquery.js" type="text/javascript"></script>
    <script src="../../../script/jquery.cookie.js" type="text/javascript"></script>
    <script src="../../../script/jquery.treeview.js" type="text/javascript"></script>
    <script type="text/javascript">
		                $(document).ready(function(){

		                // first example
		                $("#navigation1").treeview({
			                persist: "location",
			                collapsed: true,
			                unique: true
		                });

		                $("#navigation2").treeview({
			                persist: "location",
			                collapsed: true,
			                unique: true
		                });

		                });
	                </script>
    <title>View</title>
  </head>
  <body>
    <h1>
      <img src="../../../Images/icons/view.png" alt="view icon" /> View: vEmployee</h1>
    <h2>Properties</h2>
    <table id="GetViewList">
      <tr>
        <th>Property</th>
        <th>Value</th>
      </tr>
      <tr>
        <td>Name</td>
        <td>vEmployee</td>
      </tr>
      <tr>
        <td>ID</td>
        <td>1803153469</td>
      </tr>
      <tr>
        <td>Schema</td>
        <td>
          <a href="../../Schemas/Details/Detail_5.html">HumanResources</a>
        </td>
      </tr>
      <tr>
        <td>Owner</td>
        <td>
          <a href="../../Users/Details/Detail_1.html">dbo</a>
        </td>
      </tr>
      <tr>
        <td>Encrypted</td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>Schema Bound</td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>With Check Option</td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>ANSI NULLS</td>
        <td>
          <img src="../../../images/icons/true.png" alt="true" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>Uses Quoted Identifier</td>
        <td>
          <img src="../../../images/icons/true.png" alt="true" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>Has Opaque Metadata</td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>Published</td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>Schema Published</td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>Replicated</td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>Has Replication Filter</td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>Has Unchecked Assembly Data</td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>Date Correlation View</td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>Uses Database Collation</td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>Tracked by CDC</td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>MS Shipped</td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>Modify Date</td>
        <td>8/8/2010 5:23:44 PM</td>
      </tr>
      <tr>
        <td>Create Date</td>
        <td>8/8/2010 5:23:44 PM</td>
      </tr>
    </table>
    <h2>Extended Properties</h2>
    <table>
      <tr>
        <th>Name</th>
        <th>Value</th>
      </tr>
      <tr>
        <td>MS_Description</td>
        <td>Employee names and addresses.</td>
      </tr>
    </table>
    <h2>View Columns</h2>
    <table>
      <tr>
        <th>Column Name</th>
        <th>Datatype</th>
        <th>Nullable</th>
        <th>Is Identity</th>
      </tr>
      <tr>
        <td>
          <a href="Columns/Column_1803153469_1.html">BusinessEntityID</a>
        </td>
        <td>int</td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>
          <a href="Columns/Column_1803153469_2.html">Title</a>
        </td>
        <td>nvarchar(8)</td>
        <td>
          <img src="../../../images/icons/true.png" alt="true" class="boolean" />
        </td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>
          <a href="Columns/Column_1803153469_3.html">FirstName</a>
        </td>
        <td>Name</td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>
          <a href="Columns/Column_1803153469_4.html">MiddleName</a>
        </td>
        <td>Name</td>
        <td>
          <img src="../../../images/icons/true.png" alt="true" class="boolean" />
        </td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>
          <a href="Columns/Column_1803153469_5.html">LastName</a>
        </td>
        <td>Name</td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>
          <a href="Columns/Column_1803153469_6.html">Suffix</a>
        </td>
        <td>nvarchar(10)</td>
        <td>
          <img src="../../../images/icons/true.png" alt="true" class="boolean" />
        </td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>
          <a href="Columns/Column_1803153469_7.html">JobTitle</a>
        </td>
        <td>nvarchar(50)</td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>
          <a href="Columns/Column_1803153469_8.html">PhoneNumber</a>
        </td>
        <td>Phone</td>
        <td>
          <img src="../../../images/icons/true.png" alt="true" class="boolean" />
        </td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>
          <a href="Columns/Column_1803153469_9.html">PhoneNumberType</a>
        </td>
        <td>Name</td>
        <td>
          <img src="../../../images/icons/true.png" alt="true" class="boolean" />
        </td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>
          <a href="Columns/Column_1803153469_10.html">EmailAddress</a>
        </td>
        <td>nvarchar(50)</td>
        <td>
          <img src="../../../images/icons/true.png" alt="true" class="boolean" />
        </td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>
          <a href="Columns/Column_1803153469_11.html">EmailPromotion</a>
        </td>
        <td>int</td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>
          <a href="Columns/Column_1803153469_12.html">AddressLine1</a>
        </td>
        <td>nvarchar(60)</td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>
          <a href="Columns/Column_1803153469_13.html">AddressLine2</a>
        </td>
        <td>nvarchar(60)</td>
        <td>
          <img src="../../../images/icons/true.png" alt="true" class="boolean" />
        </td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>
          <a href="Columns/Column_1803153469_14.html">City</a>
        </td>
        <td>nvarchar(30)</td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>
          <a href="Columns/Column_1803153469_15.html">StateProvinceName</a>
        </td>
        <td>Name</td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>
          <a href="Columns/Column_1803153469_16.html">PostalCode</a>
        </td>
        <td>nvarchar(15)</td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>
          <a href="Columns/Column_1803153469_17.html">CountryRegionName</a>
        </td>
        <td>Name</td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
      <tr>
        <td>
          <a href="Columns/Column_1803153469_18.html">AdditionalContactInfo</a>
        </td>
        <td>xml</td>
        <td>
          <img src="../../../images/icons/true.png" alt="true" class="boolean" />
        </td>
        <td>
          <img src="../../../images/icons/false.png" alt="false" class="boolean" />
        </td>
      </tr>
    </table>
    <h2>Indexes</h2>
    <span>No view indexes defined.</span>
    <h2>Object Level Permissions</h2>
    <p>
      <h4>Permissions for: <a href="../../Roles/Details/Detail_7.html">KrystianRole</a></h4>
      <table>
        <tr>
          <th>Permission</th>
          <th>Grantor</th>
          <th>Grant</th>
          <th>With Grant Option</th>
          <th>Deny</th>
        </tr>
        <tr>
          <td>Alter</td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
        </tr>
        <tr>
          <td>Control</td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
        </tr>
        <tr>
          <td>Delete</td>
          <td>dbo</td>
          <td>
            <img src="../../../images/icons/true.png" alt="true" class="boolean" />
          </td>
          <td></td>
          <td></td>
        </tr>
        <tr>
          <td>Execute</td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
        </tr>
        <tr>
          <td>Insert</td>
          <td>dbo</td>
          <td>
            <img src="../../../images/icons/true.png" alt="true" class="boolean" />
          </td>
          <td></td>
          <td></td>
        </tr>
        <tr>
          <td>Receive</td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
        </tr>
        <tr>
          <td>References</td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
        </tr>
        <tr>
          <td>Select</td>
          <td>dbo</td>
          <td></td>
          <td>
            <img src="../../../images/icons/true.png" alt="true" class="boolean" />
          </td>
          <td></td>
        </tr>
        <tr>
          <td>Take Ownership</td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
        </tr>
        <tr>
          <td>Update</td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
        </tr>
        <tr>
          <td>View Change Tracking</td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
        </tr>
        <tr>
          <td>View Definition</td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
        </tr>
      </table>
    </p>
    <h2>Column Level Permissions</h2>
    <p>
      <h4>Permissions for: <a href="../../Users/Details/Detail_6.html">JohnBlack</a></h4>
      <h5>
        <h5>
          <a href="../../Views/Details/Columns/Column_1803153469_14.html">City</a>
        </h5>
      </h5>
      <table>
        <tr>
          <th>Permission</th>
          <th>Grantor</th>
          <th>Grant</th>
          <th>With Grant</th>
          <th>Deny</th>
        </tr>
        <tr>
          <td>SELECT</td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
        </tr>
        <tr>
          <td>REFERENCES</td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
        </tr>
        <tr>
          <td>UPDATE</td>
          <td>dbo</td>
          <td>
            <img src="../../../images/icons/true.png" alt="true" class="boolean" />
          </td>
          <td></td>
          <td></td>
        </tr>
      </table>
      <h5>
        <h5>
          <a href="../../Views/Details/Columns/Column_1803153469_2.html">Title</a>
        </h5>
      </h5>
      <table>
        <tr>
          <th>Permission</th>
          <th>Grantor</th>
          <th>Grant</th>
          <th>With Grant</th>
          <th>Deny</th>
        </tr>
        <tr>
          <td>SELECT</td>
          <td>dbo</td>
          <td>
            <img src="../../../images/icons/true.png" alt="true" class="boolean" />
          </td>
          <td></td>
          <td></td>
        </tr>
        <tr>
          <td>REFERENCES</td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
        </tr>
        <tr>
          <td>UPDATE</td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
        </tr>
      </table>
    </p>
    <h2>Objects that depend on [vEmployee]</h2>
    <ul id="navigation1">
      <li>
        <a href="../../Views/Details/Detail_1803153469.html">HumanResources.vEmployee</a>
      </li>
    </ul>
    <h2>Objects on which [vEmployee] depends</h2>
    <ul id="navigation2">
      <li>
        <a href="../../Views/Details/Detail_1803153469.html">HumanResources.vEmployee</a>
        <ul>
          <li>
            <a href="../../Tables/Details/Detail_981578535.html">HumanResources.Employee</a>
            <ul>
              <li>
                <a href="../../Datatypes/Details/Detail_258.html">dbo.Flag</a>
              </li>
              <li>
                <a href="../../Tables/Details/Detail_1509580416.html">Person.Person</a>
                <ul>
                  <li>
                    <a href="../../Datatypes/Details/Detail_260.html">dbo.Name</a>
                  </li>
                  <li>
                    <a href="../../Datatypes/Details/Detail_259.html">dbo.NameStyle</a>
                  </li>
                  <li>Demographics.exist</li>
                  <li>
                    <a href="../../XmlSchemaCollections/Details/Detail_65536.html">Person.AdditionalContactInfoSchemaCollection</a>
                  </li>
                  <li>
                    <a href="../../Tables/Details/Detail_341576255.html">Person.BusinessEntity</a>
                  </li>
                  <li>
                    <a href="../../XmlSchemaCollections/Details/Detail_65537.html">Person.IndividualSurveySchemaCollection</a>
                  </li>
                </ul>
              </li>
            </ul>
          </li>
          <li>
            <a href="../../Tables/Details/Detail_85575343.html">Person.Address</a>
            <ul>
              <li>
                <a href="../../Tables/Details/Detail_206623779.html">Person.StateProvince</a>
                <ul>
                  <li>
                    <a href="../../Tables/Details/Detail_549576996.html">Person.CountryRegion</a>
                  </li>
                  <li>
                    <a href="../../Tables/Details/Detail_1666104976.html">Sales.SalesTerritory</a>
                  </li>
                </ul>
              </li>
            </ul>
          </li>
          <li>
            <a href="../../Tables/Details/Detail_389576426.html">Person.BusinessEntityAddress</a>
            <ul>
              <li>
                <a href="../../Tables/Details/Detail_133575514.html">Person.AddressType</a>
              </li>
            </ul>
          </li>
          <li>
            <a href="../../Tables/Details/Detail_933578364.html">Person.EmailAddress</a>
          </li>
          <li>
            <a href="../../Tables/Details/Detail_1653580929.html">Person.PersonPhone</a>
            <ul>
              <li>
                <a href="../../Datatypes/Details/Detail_262.html">dbo.Phone</a>
              </li>
              <li>
                <a href="../../Tables/Details/Detail_1685581043.html">Person.PhoneNumberType</a>
              </li>
            </ul>
          </li>
        </ul>
      </li>
    </ul>
    <h2>SQL</h2>
    <table>
      <tr>
        <th>Script</th>
      </tr>
      <tr>
        <td>SET ANSI_NULLS ON<br />SET QUOTED_IDENTIFIER ON<br />CREATE VIEW [HumanResources].[vEmployee] 
AS 
SELECT 
e.[BusinessEntityID]
,p.[Title]
,p.[FirstName]
,p.[MiddleName]
,p.[LastName]
,p.[Suffix]
,e.[JobTitle]  
,pp.[PhoneNumber]
,pnt.[Name] AS [PhoneNumberType]
,ea.[EmailAddress]
,p.[EmailPromotion]
,a.[AddressLine1]
,a.[AddressLine2]
,a.[City]
,sp.[Name] AS [StateProvinceName] 
,a.[PostalCode]
,cr.[Name] AS [CountryRegionName] 
,p.[AdditionalContactInfo]
FROM [HumanResources].[Employee] e
INNER JOIN [Person].[Person] p
ON p.[BusinessEntityID] = e.[BusinessEntityID]
INNER JOIN [Person].[BusinessEntityAddress] bea 
ON bea.[BusinessEntityID] = e.[BusinessEntityID] 
INNER JOIN [Person].[Address] a 
ON a.[AddressID] = bea.[AddressID]
INNER JOIN [Person].[StateProvince] sp 
ON sp.[StateProvinceID] = a.[StateProvinceID]
INNER JOIN [Person].[CountryRegion] cr 
ON cr.[CountryRegionCode] = sp.[CountryRegionCode]
LEFT OUTER JOIN [Person].[PersonPhone] pp
ON pp.BusinessEntityID = p.[BusinessEntityID]
LEFT OUTER JOIN [Person].[PhoneNumberType] pnt
ON pp.[PhoneNumberTypeID] = pnt.[PhoneNumberTypeID]
LEFT OUTER JOIN [Person].[EmailAddress] ea
ON p.[BusinessEntityID] = ea.[BusinessEntityID];
<br />EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Employee names and addresses.' , @level0type=N'SCHEMA',@level0name=N'HumanResources', @level1type=N'VIEW',@level1name=N'vEmployee'<br /></td>
      </tr>
    </table>
    <h4 class="seealso">See also</h4>
    <a href="../General.html">List of Views</a>
  </body>
</html>