HumanResources.uspUpdateEmployeeLogin Stored Procedure
In This Topic
Description
Updates the Employee table with the values specified in the input parameters for the given BusinessEntityID.
Properties
Creation Date | 27/10/2017 14:33 |
Encrypted | |
Ansi Nulls | |
Parameters
Parameter | Direction | Description | Data Type | Size |
@BusinessEntityID | In | Input parameter for the stored procedure uspUpdateEmployeeLogin. Enter a valid EmployeeID from the Employee table. | Integer | 4 |
@OrganizationNode | In | Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a valid ManagerID for the employee. | UserDefined | 892 |
@LoginID | In | Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a valid login for the employee. | VarWChar | 256 |
@JobTitle | In | Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a title for the employee. | VarWChar | 50 |
@HireDate | In | Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a hire date for the employee. | DBTimeStamp | 4 |
@CurrentFlag | In | Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter the current flag for the employee. | dbo.Flag | 1 |
@RETURN_VALUE | Return Value | | Integer | 4 |
Objects that HumanResources.uspUpdateEmployeeLogin depends on
| Database Object | Object Type | Description | Dep Level |
| Person.BusinessEntity | Table | Source of the ID that connects vendors, customers, and employees with address and contact information. | 2 |
| HumanResources.Employee | Table | Employee information such as salary, department, and title. | 3 |
| dbo.ErrorLog | Table | Audit table tracking errors in the the AdventureWorks database that are caught by the CATCH block of a TRY...CATCH construct. Data is inserted by stored procedure dbo.uspLogError when it is executed from inside the CATCH block of a TRY...CATCH construct. | 3 |
| dbo.Flag | User Defined Data Type | | 4 |
| dbo.Name | User Defined Data Type | | 2 |
| dbo.NameStyle | User Defined Data Type | | 5 |
| Person.Person | Table | Human beings involved with AdventureWorks: employees, customer contacts, and vendor contacts. | 4 |
| dbo.uspLogError | Stored Procedure | Logs error information in the ErrorLog table about the error that caused execution to jump to the CATCH block of a TRY...CATCH construct. Should be executed from within the scope of a CATCH block otherwise it will return without inserting error information. | 2 |
| dbo.uspPrintError | Stored Procedure | Prints error information about the error that caused execution to jump to the CATCH block of a TRY...CATCH construct. Should be executed from within the scope of a CATCH block otherwise it will return without printing any error information. | 2 |
Procedure Source Code
CREATE PROCEDURE [HumanResources].[uspUpdateEmployeeLogin]
@BusinessEntityID [int],
@OrganizationNode [hierarchyid],
@LoginID [nvarchar](256),
@JobTitle [nvarchar](50),
@HireDate [datetime],
@CurrentFlag [dbo].[Flag]
WITH EXECUTE AS CALLER
AS
BEGIN
SET NOCOUNT ON;
BEGIN TRY
UPDATE [HumanResources].[Employee]
SET [OrganizationNode] = @OrganizationNode
,[LoginID] = @LoginID
,[JobTitle] = @JobTitle
,[HireDate] = @HireDate
,[CurrentFlag] = @CurrentFlag
WHERE [BusinessEntityID] = @BusinessEntityID;
END TRY
BEGIN CATCH
EXECUTE [dbo].[uspLogError];
END CATCH;
END;
|
See Also