Procedure: [AdventureWorks2016CTP3].[HumanResources].[sp_GetEmployee_Person_Info_AsOf]

CollapseAll image

Collapse image Procedure properties


 Name   Value 
 Schema   [HumanResources] 
 Owner   [dbo] 
 Creation date   23.10.2015 
 Type   P 
 Encrypted   
 ID   1982630106 
 Implementation type   Transact SQL 
 Is native compiled   

Collapse image Creation options


Name Value
QUOTED_IDENTIFIER ON
ANSI_NULLS ON

Collapse image Parameters


Name  Description Datatype  Max length  Type  ReadOnly
@asOf   datetime2 8 Input  

Collapse image Recordsets returned


Name  Datatype  Max length 
BusinessEntityID int 4
Title nvarchar 8
FirstName nvarchar 50
LastName nvarchar 50
MiddleName nvarchar 50
JobTitle nvarchar 50
MaritalStatus nchar 1
Gender nchar 1
VacationHours smallint 2
SickLeaveHours smallint 2
Name  Datatype  Max length 
BusinessEntityID int 4
Title nvarchar 8
FirstName nvarchar 50
LastName nvarchar 50
MiddleName nvarchar 50
JobTitle nvarchar 50
MaritalStatus nchar 1
Gender nchar 1
VacationHours smallint 2
SickLeaveHours smallint 2

Collapse image Objects that [HumanResources].[sp_GetEmployee_Person_Info_AsOf] depends on


Object name Object type Dep level
[HumanResources] Schema 1
[HumanResources].[vEmployeePersonTemporalInfo] View 1
Total 2 object(s)

Collapse image SQL


SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO

/*
    Stored procedure used for querying Employee and Person data AS OF
    If @AsOf parameter is NULL, current data is queried
    otherwise both current and historical data is queried
*/
CREATE  PROCEDURE [HumanResources].[sp_GetEmployee_Person_Info_AsOf]
@asOf datetime2 = NULL
AS
IF @asOf IS NULL
    SELECT * FROM [HumanResources].[vEmployeePersonTemporalInfo]
ELSE
    SELECT * FROM [HumanResources].[vEmployeePersonTemporalInfo] FOR SYSTEM_TIME AS OF @asOf;
GO

Collapse image See also


List of procedures