D
Drew
I have built a report for showing Employee Information. It runs off the
following SP,
CREATE PROCEDURE spEmpInfo
@EmpSSNEntry varchar(15),
AS
IF @EmpSSNEntry IS NULL
SELECT E.EmpID, P.PosID, E.EmpFName, E.EmpMName, E.EmpLName,
E.EmpSuffix, E.EmpShift, E.EmpStatus, E.EmpActive, P.PosRoleCode,
P.PosTimeKeeper, C.CostCenter, EF.EmpSalary,
EF.EmpDirectDeposit, EF.EmpInsID, EP.EmpRace, EP.EmpSex, EP.EmpDOB,
EP.EmpStateBegDate,
EP.EmpSWVTCBegDate, EP.EmpSWVTCSepDate,
EP.EmpPositionBegDate, EP.EmpPositionSepDate, EP.EmpSSN, EP.EmpAddress,
EP.EmpOtherAddress, EP.EmpCity, EP.EmpState,
EP.EmpZip, EP.EmpSepReason
FROM EmpCore.dbo.tblEmployee E INNER JOIN
EmpCore.dbo.tblPosition P ON E.PosID = P.PosID INNER
JOIN
EmpCore.dbo.tblCostCenter C ON P.PosCostCenter =
C.CostCenterID INNER JOIN
dbo.tblEmpInfo EF ON E.EmpID = EF.EmpID INNER JOIN
EmpPersonal.dbo.tblEmpPersonalInfo EP ON E.EmpID =
EP.EmpID
WHERE (E.EmpActive = 1)
ELSE
SELECT E.EmpID, P.PosID, E.EmpFName, E.EmpMName, E.EmpLName,
E.EmpSuffix, E.EmpShift, E.EmpStatus, E.EmpActive, P.PosRoleCode,
P.PosTimeKeeper, C.CostCenter, EF.EmpSalary,
EF.EmpDirectDeposit, EF.EmpInsID, EP.EmpRace, EP.EmpSex, EP.EmpDOB,
EP.EmpStateBegDate,
EP.EmpSWVTCBegDate, EP.EmpSWVTCSepDate,
EP.EmpPositionBegDate, EP.EmpPositionSepDate, EP.EmpSSN, EP.EmpAddress,
EP.EmpOtherAddress, EP.EmpCity, EP.EmpState,
EP.EmpZip, EP.EmpSepReason
FROM EmpCore.dbo.tblEmployee E INNER JOIN
EmpCore.dbo.tblPosition P ON E.PosID = P.PosID INNER
JOIN
EmpCore.dbo.tblCostCenter C ON P.PosCostCenter =
C.CostCenterID INNER JOIN
dbo.tblEmpInfo EF ON E.EmpID = EF.EmpID INNER JOIN
EmpPersonal.dbo.tblEmpPersonalInfo EP ON E.EmpID =
EP.EmpID
WHERE (E.EmpActive = 1) AND EP.EmpSSN = @EmpSSNEntry
GO
I need to make this stored procedure have the ability to take up to 10 SSN
at once to return 10 records. There is a limit of 10, but there could only
be 1 SSN entered.
Does anyone know how I can go about doing this?
Thanks,
Drew Laing
following SP,
CREATE PROCEDURE spEmpInfo
@EmpSSNEntry varchar(15),
AS
IF @EmpSSNEntry IS NULL
SELECT E.EmpID, P.PosID, E.EmpFName, E.EmpMName, E.EmpLName,
E.EmpSuffix, E.EmpShift, E.EmpStatus, E.EmpActive, P.PosRoleCode,
P.PosTimeKeeper, C.CostCenter, EF.EmpSalary,
EF.EmpDirectDeposit, EF.EmpInsID, EP.EmpRace, EP.EmpSex, EP.EmpDOB,
EP.EmpStateBegDate,
EP.EmpSWVTCBegDate, EP.EmpSWVTCSepDate,
EP.EmpPositionBegDate, EP.EmpPositionSepDate, EP.EmpSSN, EP.EmpAddress,
EP.EmpOtherAddress, EP.EmpCity, EP.EmpState,
EP.EmpZip, EP.EmpSepReason
FROM EmpCore.dbo.tblEmployee E INNER JOIN
EmpCore.dbo.tblPosition P ON E.PosID = P.PosID INNER
JOIN
EmpCore.dbo.tblCostCenter C ON P.PosCostCenter =
C.CostCenterID INNER JOIN
dbo.tblEmpInfo EF ON E.EmpID = EF.EmpID INNER JOIN
EmpPersonal.dbo.tblEmpPersonalInfo EP ON E.EmpID =
EP.EmpID
WHERE (E.EmpActive = 1)
ELSE
SELECT E.EmpID, P.PosID, E.EmpFName, E.EmpMName, E.EmpLName,
E.EmpSuffix, E.EmpShift, E.EmpStatus, E.EmpActive, P.PosRoleCode,
P.PosTimeKeeper, C.CostCenter, EF.EmpSalary,
EF.EmpDirectDeposit, EF.EmpInsID, EP.EmpRace, EP.EmpSex, EP.EmpDOB,
EP.EmpStateBegDate,
EP.EmpSWVTCBegDate, EP.EmpSWVTCSepDate,
EP.EmpPositionBegDate, EP.EmpPositionSepDate, EP.EmpSSN, EP.EmpAddress,
EP.EmpOtherAddress, EP.EmpCity, EP.EmpState,
EP.EmpZip, EP.EmpSepReason
FROM EmpCore.dbo.tblEmployee E INNER JOIN
EmpCore.dbo.tblPosition P ON E.PosID = P.PosID INNER
JOIN
EmpCore.dbo.tblCostCenter C ON P.PosCostCenter =
C.CostCenterID INNER JOIN
dbo.tblEmpInfo EF ON E.EmpID = EF.EmpID INNER JOIN
EmpPersonal.dbo.tblEmpPersonalInfo EP ON E.EmpID =
EP.EmpID
WHERE (E.EmpActive = 1) AND EP.EmpSSN = @EmpSSNEntry
GO
I need to make this stored procedure have the ability to take up to 10 SSN
at once to return 10 records. There is a limit of 10, but there could only
be 1 SSN entered.
Does anyone know how I can go about doing this?
Thanks,
Drew Laing