Wednesday, June 8, 2022

Update Employee Table

  


---   

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

Screen Record

 Windows Screen Record WindowsKey+ Alt + R Recording Starts.