Northwind Database (Document! X Sample)
AdventureWorks Database / HumanResources Schema / HumanResources.vJobCandidateEmployment View
In This Topic
    HumanResources.vJobCandidateEmployment View
    In This Topic
    Description
    Displays the content from each employement history related element in the xml column Resume in the HumanResources.JobCandidate table. The content has been localized into French, Simplified Chinese and Thai. Some data may not display correctly unless supplemental language support is installed.
    Properties
    Creation Date27/10/2017 14:33
    Is Schema Bound
    Encrypted
    Ansi Nulls
    Columns
     Column NameDescriptionDatatypeLengthAllow NullsDefaultFormula
      Integer4   
      DBTimeStamp4  
      DBTimeStamp4  
      VarWChar100  
      VarWChar100  
      LongVarWChar16  
      LongVarWChar16  
      LongVarWChar16  
      LongVarWChar16  
      LongVarWChar16  
      LongVarWChar16  
    Objects that HumanResources.vJobCandidateEmployment 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.Employee tableHumanResources.EmployeeTableEmployee information such as salary, department, and title.3
    dbo.Flag datatypedbo.FlagUser Defined Data Type 4
    HumanResources.JobCandidate tableHumanResources.JobCandidateTableRésumés submitted to Human Resources by job applicants.2
    dbo.Name datatypedbo.NameUser Defined Data Type 2
    dbo.NameStyle datatypedbo.NameStyleUser Defined Data Type 5
    Person.Person tablePerson.PersonTableHuman beings involved with AdventureWorks: employees, customer contacts, and vendor contacts.4
    View Definition
    CREATE VIEW [HumanResources].[vJobCandidateEmployment] 
    AS 
    
    SELECT 
        jc.[JobCandidateID] 
        ,CONVERT(datetime, REPLACE([Employment].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
            (Emp.StartDate)[1]', 'nvarchar(20)') ,'Z', ''), 101) AS [Emp.StartDate] 
        ,CONVERT(datetime, REPLACE([Employment].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
            (Emp.EndDate)[1]', 'nvarchar(20)') ,'Z', ''), 101) AS [Emp.EndDate] 
        ,[Employment].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
            (Emp.OrgName)[1]', 'nvarchar(100)') AS [Emp.OrgName]
        ,[Employment].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
            (Emp.JobTitle)[1]', 'nvarchar(100)') AS [Emp.JobTitle]
        ,[Employment].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
            (Emp.Responsibility)[1]', 'nvarchar(max)') AS [Emp.Responsibility]
        ,[Employment].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
            (Emp.FunctionCategory)[1]', 'nvarchar(max)') AS [Emp.FunctionCategory]
        ,[Employment].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
            (Emp.IndustryCategory)[1]', 'nvarchar(max)') AS [Emp.IndustryCategory]
        ,[Employment].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
            (Emp.Location/Location/Loc.CountryRegion)[1]', 'nvarchar(max)') AS [Emp.Loc.CountryRegion]
        ,[Employment].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
            (Emp.Location/Location/Loc.State)[1]', 'nvarchar(max)') AS [Emp.Loc.State]
        ,[Employment].ref.value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
            (Emp.Location/Location/Loc.City)[1]', 'nvarchar(max)') AS [Emp.Loc.City]
    FROM [HumanResources].[JobCandidate] jc 
    CROSS APPLY jc.[Resume].nodes(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume"; 
        /Resume/Employment') AS Employment(ref);
    
    See Also