Properties

Owner: HumanResources 
Encrypted:  
Creation Date: 04/26/2006 
Modification Date:  
Description: Updates the Employee table with the values specified in the input parameters for the given EmployeeID. 

Creation options

QUOTED_IDENTIFIER:  
ANSI_NULLS:  

Parameters

Name Direction DataType Length Default Description
  @EmployeeID  INPUT  int    Input parameter for the stored procedure uspUpdateEmployeePersonalInfo. Enter a valid EmployeeID from the HumanResources.Employee table. 
  @NationalIDNumber  INPUT  nvarchar  15    Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a national ID for the employee. 
  @BirthDate  INPUT  datetime    Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a birth date for the employee. 
  @MaritalStatus  INPUT  nchar    Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a marital status for the employee. 
  @Gender  INPUT  nchar    Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a gender for the employee. 
Total: 5 parameter(s)

Objects that [HumanResources].[uspUpdateEmployeePersonalInfo] depends on

Object Name Owner Object Type Dep Level
  Flag  dbo  User Defined type 
  Name  dbo  User Defined type 
  NameStyle  dbo  User Defined type 
  Phone  dbo  User Defined type 
  Contact  Person  Table 
  ErrorLog  dbo  Table 
  uspPrintError  dbo  Procedure 
  Employee  HumanResources  Table 
  uspLogError  dbo  Procedure 
Total: 9 object(s)

SQL

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE PROCEDURE [HumanResources].[uspUpdateEmployeePersonalInfo]
    @EmployeeID [int],
    @NationalIDNumber [nvarchar](15),
    @BirthDate [datetime],
    @MaritalStatus [nchar](1),
    @Gender [nchar](1)
WITH EXECUTE AS CALLER
AS
BEGIN
    SET NOCOUNT ON;

    BEGIN TRY
        UPDATE [HumanResources].[Employee]
        SET [NationalIDNumber] = @NationalIDNumber
            ,[BirthDate] = @BirthDate
            ,[MaritalStatus] = @MaritalStatus
            ,[Gender] = @Gender
        WHERE [EmployeeID] = @EmployeeID;
    END TRY
    BEGIN CATCH
        EXECUTE [dbo].[uspLogError];
    END CATCH;
END;

GO
SET QUOTED_IDENTIFIER OFF
GO

GO
SET ANSI_NULLS OFF
GO

See Also

List of stored procedures