This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: END -- Use the ShortName and FamilySize functions SELECT dbo.ShortName(FirstName, LastName) AS Employee, dbo.FamilySize(EID) AS Size FROM tblEmployee ORDER BY LastName, FirstName-- Procedure to give all current employees a 5% raise CREATE PROC spPayRaise AS BEGIN UPDATE tblEmployee SET AnnualSalary=ROUND(1.05*AnnualSalary,2) WHERE Active='Y' END -- Procedure to give all current employees an X dollar raise CREATE PROC spPayRaise2 @X Money AS BEGIN UPDATE tblEmployee SET AnnualSalary=AnnualSalary + @X WHERE Active='Y' END -- Procedure to remove an employee, his family and his paychecks CREATE PROC spDiscardEmployee @EID Varchar(20) AS BEGIN DELETE tblPaycheck WHERE [email protected] DELETE tblFamily WHERE [email protected] DELETE tblEmployee WHERE [email protected] END -- Use the stored procedures EXEC spPayRaise EXEC spPayRaise2 2500.00 EXEC spDiscardEmployee 'MT26' EXEC spDiscardEmployee 'OMP' EXEC spDiscardEmployee 'JMote'...
View Full Document
This note was uploaded on 05/26/2011 for the course MIS 325 taught by Professor Mote during the Spring '08 term at University of Texas.
- Spring '08