create procedure GETNames
@rpt char(1)
as
if rpt = '1', '3', '4', '5'
then
SELECT FirstName, LastName, JobTitle, Department
FROM HumanResources
WHERE rpt=@rpt
else if rpt='2'
SELECT FirstName, LastName, JobTitle, Department
EmployeeDepartment
WHERE rpt='2'
end if
I want rpt='2' to have it's own select statement as different data needs to appear.
@rpt char(1)
as
if rpt = '1', '3', '4', '5'
then
SELECT FirstName, LastName, JobTitle, Department
FROM HumanResources
WHERE rpt=@rpt
else if rpt='2'
SELECT FirstName, LastName, JobTitle, Department
EmployeeDepartment
WHERE rpt='2'
end if
I want rpt='2' to have it's own select statement as different data needs to appear.