---
declare
@InitialData Table(
RowNum int IDENTITY(1,1) NOT NULL ,
EmployeeCode nvarchar(20)
)
INSERT INTO @InitialData
SELECT [Employee Code] FROM NXTRPTEmployeeProfile WHERE [daysIN Zone Office] is NULL
DECLARE @RowSl INT
,@Count INT
SET @RowSl = 1
SET @Count = (SELECT COUNT(*) FROM @InitialData)
WHILE @RowSl <= @Count
BEGIN
declare @currentEmployee varchar(20)
SELECT @currentEmployee = [EmployeeCode] FROM @InitialData WHERE RowNum = @RowSl
Update NXTRPTEmployeeProfile SET [daysIN Zone Office] = dbo.GetZoneOfficeDurationKF1Days(@currentEmployee)
WHERE [Employee code] = @currentEmployee
SET @RowSl += 1
END -- End While
No comments:
Post a Comment