Microsoft Office Tutorials and References
In Depth Information
Gender, HireDate, SalariedFlag, VacationHours, SickLeaveHours, CurrentFlag, ModifiedDate
FROM
HumanResources.Employee
WHERE OrganizationNode.GetAncestor(1) IS NOT NULL
END
GO
Listing 4-2. Stored Procedure for Retrieving Specific Employee Information Using Employee ID
USE [AdventureWorks2012]
GO
CREATE PROCEDURE [dbo].[uspGetEmployeesById]
@BusinessEntityID [int]
AS
BEGIN
SET NOCOUNT ON;
SELECT BusinessEntityID, NationalIDNumber, LoginID, JobTitle, BirthDate, MaritalStatus,
Gender, HireDate, SalariedFlag, VacationHours, SickLeaveHours, CurrentFlag, ModifiedDate
FROM
HumanResources.Employee
WHERE
BusinessEntityID = @BusinessEntityID
END
GO
Listing 4-3. Stored Procedure for Updating Specific Employee Information Based on Employee ID
USE [AdventureWorks2012]
GO
CREATE PROCEDURE [dbo].[uspSetEmployeesValueById]
@BusinessEntityID [int],
@NationalIDNumber nvarchar(15),
@LoginID nvarchar(256),
@JobTitle nvarchar(50),
@BirthDate DateTime,
@MaritalStatus nchar(1),
@Gender nchar(1),
@HireDate DateTime,
@SalariedFlag bit,
@VacationHours smallint,
@SickLeaveHours smallint,
@CurrentFlag bit,
@ModifiedDate DateTime
AS
Search JabSto ::




Custom Search