IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1684')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1684'),
'Gastrointestinal',
'SICK' ,
'13 May 2025',
'15 May 2025',
'Sick')
END ELSE PRINT('1684: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2178')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2178'),
'Tooth issues',
'TOO' ,
'02 Sep 2025',
'02 Sep 2025',
'Sick')
END ELSE PRINT('2178: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1648')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1648'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'06 Jan 2025',
'07 Jan 2025',
'Sick')
END ELSE PRINT('1648: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1470')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1470'),
'Other',
'OTH' ,
'09 Sep 2025',
'10 Sep 2025',
'Sick')
END ELSE PRINT('1470: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2311')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2311'),
'Headache and/or Migraine',
'HEAD' ,
'22 Jul 2025',
'25 Jul 2025',
'Sick')
END ELSE PRINT('2311: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2507')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2507'),
'Gastrointestinal',
'SICK' ,
'24 Jul 2025',
'24 Jul 2025',
'Sick')
END ELSE PRINT('2507: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2277')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2277'),
'Other',
'OTH' ,
'08 Oct 2025',
'10 Oct 2025',
'Sick')
END ELSE PRINT('2277: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1504')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1504'),
'Gastrointestinal',
'SICK' ,
'29 Sep 2025',
'29 Sep 2025',
'Sick')
END ELSE PRINT('1504: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1925')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1925'),
'Gastrointestinal',
'SICK' ,
'24 Jul 2025',
'25 Jul 2025',
'Sick')
END ELSE PRINT('1925: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2573')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2573'),
'Other',
'OTH' ,
'28 Jul 2025',
'28 Jul 2025',
'Sick')
END ELSE PRINT('2573: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1819')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1819'),
'Musculoskeletal',
'MUSC' ,
'27 Aug 2025',
'28 Aug 2025',
'Sick')
END ELSE PRINT('1819: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2515')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2515'),
'Respiratory issues',
'RESPI' ,
'08 Jan 2025',
'10 Jan 2025',
'Sick')
END ELSE PRINT('2515: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2555')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2555'),
'Gastrointestinal',
'SICK' ,
'09 Sep 2025',
'09 Sep 2025',
'Sick')
END ELSE PRINT('2555: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1796')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1796'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'06 Jan 2025',
'06 Jan 2025',
'Sick')
END ELSE PRINT('1796: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1796')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1796'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'30 Sep 2025',
'03 Oct 2025',
'Sick')
END ELSE PRINT('1796: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1796')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1796'),
'Gastrointestinal',
'SICK' ,
'28 Jul 2025',
'28 Jul 2025',
'Sick')
END ELSE PRINT('1796: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2554')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2554'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'16 Sep 2025',
'17 Sep 2025',
'Sick')
END ELSE PRINT('2554: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1816')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1816'),
'Other',
'OTH' ,
'25 Jun 2025',
'26 Jun 2025',
'Sick')
END ELSE PRINT('1816: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2062')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2062'),
'Gastrointestinal',
'SICK' ,
'04 Aug 2025',
'05 Aug 2025',
'Sick')
END ELSE PRINT('2062: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1612')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1612'),
'Gastrointestinal',
'SICK' ,
'15 Sep 2025',
'16 Sep 2025',
'Sick')
END ELSE PRINT('1612: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2456')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2456'),
'Mental Health',
'MH' ,
'07 Jan 2025',
'07 Jan 2025',
'Sick')
END ELSE PRINT('2456: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2456')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2456'),
'Other',
'OTH' ,
'24 Sep 2025',
'24 Sep 2025',
'Sick')
END ELSE PRINT('2456: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2366')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2366'),
'Gastrointestinal',
'SICK' ,
'22 Sep 2025',
'23 Sep 2025',
'Sick')
END ELSE PRINT('2366: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2221')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2221'),
'Hospital appointment and/or treatment',
'APPT' ,
'03 Oct 2025',
'17 Oct 2025',
'Sick')
END ELSE PRINT('2221: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1555')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1555'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'06 Jan 2025',
'08 Jan 2025',
'Sick')
END ELSE PRINT('1555: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1555')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1555'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'05 Sep 2025',
'05 Sep 2025',
'Sick')
END ELSE PRINT('1555: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2501')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2501'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'30 Jul 2025',
'31 Jul 2025',
'Sick')
END ELSE PRINT('2501: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2351')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2351'),
'Gastrointestinal',
'SICK' ,
'01 Sep 2025',
'03 Sep 2025',
'Sick')
END ELSE PRINT('2351: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2351')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2351'),
'Musculoskeletal',
'MUSC' ,
'15 Sep 2025',
'15 Sep 2025',
'Sick')
END ELSE PRINT('2351: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2351')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2351'),
'Other',
'OTH' ,
'14 Oct 2025',
'14 Oct 2025',
'Sick')
END ELSE PRINT('2351: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2577')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2577'),
'Gastrointestinal',
'SICK' ,
'14 Aug 2025',
'14 Aug 2025',
'Sick')
END ELSE PRINT('2577: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1807')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1807'),
'Headache and/or Migraine',
'HEAD' ,
'22 Jul 2025',
'22 Jul 2025',
'Sick')
END ELSE PRINT('1807: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1807')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1807'),
'Headache and/or Migraine',
'HEAD' ,
'12 Sep 2025',
'12 Sep 2025',
'Sick')
END ELSE PRINT('1807: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2205')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2205'),
'Gastrointestinal',
'SICK' ,
'01 Sep 2025',
'01 Sep 2025',
'Sick')
END ELSE PRINT('2205: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1511')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1511'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'30 May 2025',
'30 May 2025',
'Sick')
END ELSE PRINT('1511: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1677')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1677'),
'Other',
'OTH' ,
'23 Sep 2025',
'23 Sep 2025',
'Sick')
END ELSE PRINT('1677: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1677')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1677'),
'Gastrointestinal',
'SICK' ,
'09 Oct 2025',
'09 Oct 2025',
'Sick')
END ELSE PRINT('1677: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '928')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '928'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'06 Oct 2025',
'08 Oct 2025',
'Sick')
END ELSE PRINT('928: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '855')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '855'),
'Other',
'OTH' ,
'06 Oct 2025',
'07 Oct 2025',
'Sick')
END ELSE PRINT('855: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2265')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2265'),
'Hospital appointment and/or treatment',
'APPT' ,
'08 Aug 2025',
'08 Aug 2025',
'Sick')
END ELSE PRINT('2265: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2265')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2265'),
'Musculoskeletal',
'MUSC' ,
'24 Sep 2025',
'24 Sep 2025',
'Sick')
END ELSE PRINT('2265: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2329')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2329'),
'Headache and/or Migraine',
'HEAD' ,
'24 Jul 2025',
'25 Jul 2025',
'Sick')
END ELSE PRINT('2329: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1676')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1676'),
'Gastrointestinal',
'SICK' ,
'31 Jul 2025',
'01 Aug 2025',
'Sick')
END ELSE PRINT('1676: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1676')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1676'),
'Gastrointestinal',
'SICK' ,
'04 Aug 2025',
'04 Aug 2025',
'Sick')
END ELSE PRINT('1676: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2427')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2427'),
'Gastrointestinal',
'SICK' ,
'31 Jul 2025',
'01 Aug 2025',
'Sick')
END ELSE PRINT('2427: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2427')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2427'),
'Other',
'OTH' ,
'25 Sep 2025',
'26 Sep 2025',
'Sick')
END ELSE PRINT('2427: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2051')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2051'),
'Other',
'OTH' ,
'25 Jul 2025',
'25 Jul 2025',
'Sick')
END ELSE PRINT('2051: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2051')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2051'),
'Other',
'OTH' ,
'19 Sep 2025',
'19 Sep 2025',
'Sick')
END ELSE PRINT('2051: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2051')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2051'),
'Other',
'OTH' ,
'27 Oct 2025',
'31 Oct 2025',
'Sick')
END ELSE PRINT('2051: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2327')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2327'),
'Other',
'OTH' ,
'29 Sep 2025',
'29 Sep 2025',
'Sick')
END ELSE PRINT('2327: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1481')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1481'),
'Headache and/or Migraine',
'HEAD' ,
'30 Sep 2025',
'30 Sep 2025',
'Sick')
END ELSE PRINT('1481: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1593')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1593'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'26 Sep 2025',
'29 Sep 2025',
'Sick')
END ELSE PRINT('1593: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1394')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1394'),
'Other',
'OTH' ,
'24 Sep 2025',
'25 Sep 2025',
'Sick')
END ELSE PRINT('1394: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2425')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2425'),
'Other',
'OTH' ,
'27 Aug 2025',
'27 Aug 2025',
'Sick')
END ELSE PRINT('2425: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2400')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2400'),
'Other',
'OTH' ,
'03 Sep 2025',
'03 Sep 2025',
'Sick')
END ELSE PRINT('2400: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1449')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1449'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'15 Apr 2025',
'15 Apr 2025',
'Sick')
END ELSE PRINT('1449: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2576')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2576'),
'Other',
'OTH' ,
'22 Sep 2025',
'22 Sep 2025',
'Sick')
END ELSE PRINT('2576: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '272')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '272'),
'Other',
'OTH' ,
'16 Jan 2025',
'17 Jan 2025',
'Sick')
END ELSE PRINT('272: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1862')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1862'),
'Other',
'OTH' ,
'27 Jan 2025',
'31 Jan 2025',
'Sick')
END ELSE PRINT('1862: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2017')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2017'),
'Other',
'OTH' ,
'06 Feb 2025',
'06 Feb 2025',
'Sick')
END ELSE PRINT('2017: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2097')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2097'),
'Other',
'OTH' ,
'25 Jun 2025',
'25 Jun 2025',
'Sick')
END ELSE PRINT('2097: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2452')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2452'),
'Other',
'OTH' ,
'30 Sep 2025',
'30 Sep 2025',
'Sick')
END ELSE PRINT('2452: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2613')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2613'),
'Other',
'OTH' ,
'25 Sep 2025',
'26 Sep 2025',
'Sick')
END ELSE PRINT('2613: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2613')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2613'),
'Other',
'OTH' ,
'22 Sep 2025',
'24 Sep 2025',
'Sick')
END ELSE PRINT('2613: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2613')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2613'),
'Other',
'OTH' ,
'07 Nov 2025',
'07 Nov 2025',
'Sick')
END ELSE PRINT('2613: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2071')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2071'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'04 Aug 2025',
'06 Aug 2025',
'Sick')
END ELSE PRINT('2071: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2368')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2368'),
'Musculoskeletal',
'MUSC' ,
'01 Sep 2025',
'05 Sep 2025',
'Sick')
END ELSE PRINT('2368: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2290')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2290'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'04 Feb 2025',
'07 Feb 2025',
'Sick')
END ELSE PRINT('2290: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2394')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2394'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'24 Feb 2025',
'24 Feb 2025',
'Sick')
END ELSE PRINT('2394: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1941')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1941'),
'Gastrointestinal',
'SICK' ,
'11 Aug 2025',
'11 Aug 2025',
'Sick')
END ELSE PRINT('1941: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2620')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2620'),
'Gastrointestinal',
'SICK' ,
'15 Sep 2025',
'15 Sep 2025',
'Sick')
END ELSE PRINT('2620: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1280')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1280'),
'Other',
'OTH' ,
'28 Oct 2025',
'28 Oct 2025',
'Sick')
END ELSE PRINT('1280: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1732')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1732'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'02 Sep 2025',
'05 Sep 2025',
'Sick')
END ELSE PRINT('1732: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1753')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1753'),
'Other',
'OTH' ,
'23 Sep 2025',
'23 Sep 2025',
'Sick')
END ELSE PRINT('1753: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1715')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1715'),
'Hospital appointment and/or treatment',
'APPT' ,
'16 Jul 2025',
'16 Jul 2025',
'Sick')
END ELSE PRINT('1715: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1715')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1715'),
'Musculoskeletal',
'MUSC' ,
'10 Sep 2025',
'10 Sep 2025',
'Sick')
END ELSE PRINT('1715: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2042')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2042'),
'Dizziness and/or Vertigo',
'DIZ&VER' ,
'21 Aug 2025',
'21 Aug 2025',
'Sick')
END ELSE PRINT('2042: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1586')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1586'),
'Other',
'OTH' ,
'06 Jan 2025',
'10 Jan 2025',
'Sick')
END ELSE PRINT('1586: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1034')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1034'),
'Other',
'OTH' ,
'15 Sep 2025',
'17 Sep 2025',
'Sick')
END ELSE PRINT('1034: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2249')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2249'),
'Other',
'OTH' ,
'07 Apr 2025',
'10 Apr 2025',
'Sick')
END ELSE PRINT('2249: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1927')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1927'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'12 May 2025',
'13 May 2025',
'Sick')
END ELSE PRINT('1927: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1927')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1927'),
'Gastrointestinal',
'SICK' ,
'27 Aug 2025',
'28 Aug 2025',
'Sick')
END ELSE PRINT('1927: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1928')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1928'),
'Mental Health',
'MH' ,
'05 Sep 2025',
'05 Sep 2025',
'Sick')
END ELSE PRINT('1928: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1726')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1726'),
'Gastrointestinal',
'SICK' ,
'09 Jan 2025',
'10 Jan 2025',
'Sick')
END ELSE PRINT('1726: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1726')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1726'),
'Gastrointestinal',
'SICK' ,
'24 Jul 2025',
'25 Jul 2025',
'Sick')
END ELSE PRINT('1726: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1727')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1727'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'30 Sep 2025',
'03 Oct 2025',
'Sick')
END ELSE PRINT('1727: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2170')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2170'),
'Gastrointestinal',
'SICK' ,
'15 Aug 2025',
'15 Aug 2025',
'Sick')
END ELSE PRINT('2170: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1770')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1770'),
'Other',
'OTH' ,
'17 Sep 2025',
'26 Sep 2025',
'Sick')
END ELSE PRINT('1770: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2114')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2114'),
'Other',
'OTH' ,
'06 Oct 2025',
'08 Oct 2025',
'Sick')
END ELSE PRINT('2114: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2155')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2155'),
'Other',
'OTH' ,
'26 Jun 2025',
'27 Jun 2025',
'Sick')
END ELSE PRINT('2155: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1996')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1996'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'09 Jul 2025',
'09 Jul 2025',
'Sick')
END ELSE PRINT('1996: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1996')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1996'),
'Other',
'OTH' ,
'08 Sep 2025',
'09 Sep 2025',
'Sick')
END ELSE PRINT('1996: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2093')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2093'),
'Other',
'OTH' ,
'16 Sep 2025',
'16 Sep 2025',
'Sick')
END ELSE PRINT('2093: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2158')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2158'),
'Other',
'OTH' ,
'12 Aug 2025',
'13 Aug 2025',
'Sick')
END ELSE PRINT('2158: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2158')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2158'),
'Other',
'OTH' ,
'15 Aug 2025',
'22 Aug 2025',
'Sick')
END ELSE PRINT('2158: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2383')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2383'),
'Other',
'OTH' ,
'03 Oct 2025',
'03 Oct 2025',
'Sick')
END ELSE PRINT('2383: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2357')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2357'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'25 Sep 2025',
'26 Sep 2025',
'Sick')
END ELSE PRINT('2357: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2357')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2357'),
'Gastrointestinal',
'SICK' ,
'17 Jan 2025',
'17 Jan 2025',
'Sick')
END ELSE PRINT('2357: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1429')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1429'),
'Musculoskeletal',
'MUSC' ,
'12 Aug 2025',
'14 Aug 2025',
'Sick')
END ELSE PRINT('1429: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1780')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1780'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'02 Sep 2025',
'05 Sep 2025',
'Sick')
END ELSE PRINT('1780: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1239')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1239'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'18 Sep 2025',
'18 Sep 2025',
'Sick')
END ELSE PRINT('1239: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1614')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1614'),
'Other',
'OTH' ,
'05 Sep 2025',
'24 Sep 2025',
'Sick')
END ELSE PRINT('1614: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1614')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1614'),
'Other',
'OTH' ,
'29 Sep 2025',
'06 Oct 2025',
'Sick')
END ELSE PRINT('1614: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1661')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1661'),
'Gastrointestinal',
'SICK' ,
'11 Aug 2025',
'11 Aug 2025',
'Sick')
END ELSE PRINT('1661: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2091')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2091'),
'Other',
'OTH' ,
'06 Feb 2025',
'06 Feb 2025',
'Sick')
END ELSE PRINT('2091: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2629')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2629'),
'Gastrointestinal',
'SICK' ,
'25 Jul 2025',
'25 Jul 2025',
'Sick')
END ELSE PRINT('2629: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2629')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2629'),
'Gastrointestinal',
'SICK' ,
'27 Aug 2025',
'27 Aug 2025',
'Sick')
END ELSE PRINT('2629: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2629')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2629'),
'Musculoskeletal',
'MUSC' ,
'08 Sep 2025',
'09 Sep 2025',
'Sick')
END ELSE PRINT('2629: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1898')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1898'),
'Other',
'OTH' ,
'25 Jun 2025',
'25 Jun 2025',
'Sick')
END ELSE PRINT('1898: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1898')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1898'),
'Gastrointestinal',
'SICK' ,
'30 Jul 2025',
'31 Jul 2025',
'Sick')
END ELSE PRINT('1898: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1502')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1502'),
'Gastrointestinal',
'SICK' ,
'07 Apr 2025',
'07 Apr 2025',
'Sick')
END ELSE PRINT('1502: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1824')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1824'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'09 Jan 2025',
'10 Jan 2025',
'Sick')
END ELSE PRINT('1824: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1824')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1824'),
'Gastrointestinal',
'SICK' ,
'11 Jul 2025',
'11 Jul 2025',
'Sick')
END ELSE PRINT('1824: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2549')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2549'),
'Other',
'OTH' ,
'25 Sep 2025',
'25 Sep 2025',
'Sick')
END ELSE PRINT('2549: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2165')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2165'),
'Other',
'OTH' ,
'19 Sep 2025',
'22 Sep 2025',
'Sick')
END ELSE PRINT('2165: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2165')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2165'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'29 Jul 2025',
'29 Jul 2025',
'Sick')
END ELSE PRINT('2165: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1915')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1915'),
'Other',
'OTH' ,
'06 Nov 2025',
'07 Nov 2025',
'Sick')
END ELSE PRINT('1915: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2332')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2332'),
'Pregnancy related',
'PREGN' ,
'10 Sep 2025',
'10 Sep 2025',
'Sick')
END ELSE PRINT('2332: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2332')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2332'),
'Other',
'OTH' ,
'06 Oct 2025',
'06 Oct 2025',
'Sick')
END ELSE PRINT('2332: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2437')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2437'),
'Musculoskeletal',
'MUSC' ,
'02 Jun 2025',
'02 Jun 2025',
'Sick')
END ELSE PRINT('2437: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1489')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1489'),
'Other',
'OTH' ,
'24 Jun 2025',
'24 Jun 2025',
'Sick')
END ELSE PRINT('1489: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1867')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1867'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'16 Sep 2025',
'17 Sep 2025',
'Sick')
END ELSE PRINT('1867: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1805')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1805'),
'Other',
'OTH' ,
'13 Aug 2025',
'13 Aug 2025',
'Sick')
END ELSE PRINT('1805: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1133')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1133'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'13 Aug 2025',
'15 Aug 2025',
'Sick')
END ELSE PRINT('1133: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2478')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2478'),
'Mental Health',
'MH' ,
'18 Sep 2025',
'19 Sep 2025',
'Sick')
END ELSE PRINT('2478: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2190')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2190'),
'Musculoskeletal',
'MUSC' ,
'07 Jul 2025',
'07 Jul 2025',
'Sick')
END ELSE PRINT('2190: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2190')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2190'),
'Musculoskeletal',
'MUSC' ,
'09 Jul 2025',
'09 Jul 2025',
'Sick')
END ELSE PRINT('2190: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '24')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '24'),
'Other',
'OTH' ,
'03 Sep 2025',
'03 Sep 2025',
'Sick')
END ELSE PRINT('24: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '24')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '24'),
'Other',
'OTH' ,
'16 Sep 2025',
'17 Sep 2025',
'Sick')
END ELSE PRINT('24: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '422')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '422'),
'Musculoskeletal',
'MUSC' ,
'16 Jan 2025',
'17 Jan 2025',
'Sick')
END ELSE PRINT('422: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1497')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1497'),
'Headache and/or Migraine',
'HEAD' ,
'12 Aug 2025',
'12 Aug 2025',
'Sick')
END ELSE PRINT('1497: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2138')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2138'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'04 Sep 2025',
'05 Sep 2025',
'Sick')
END ELSE PRINT('2138: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2367')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2367'),
'Other',
'OTH' ,
'03 Jun 2025',
'03 Jun 2025',
'Sick')
END ELSE PRINT('2367: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2367')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2367'),
'Other',
'OTH' ,
'05 Jun 2025',
'05 Jun 2025',
'Sick')
END ELSE PRINT('2367: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2453')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2453'),
'Other',
'OTH' ,
'24 Jun 2025',
'24 Jun 2025',
'Sick')
END ELSE PRINT('2453: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2011')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2011'),
'Hospital appointment and/or treatment',
'APPT' ,
'01 Sep 2025',
'03 Sep 2025',
'Sick')
END ELSE PRINT('2011: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2275')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2275'),
'Other',
'OTH' ,
'27 Feb 2025',
'28 Feb 2025',
'Sick')
END ELSE PRINT('2275: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2589')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2589'),
'Other',
'OTH' ,
'25 Jun 2025',
'26 Jun 2025',
'Sick')
END ELSE PRINT('2589: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2347')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2347'),
'Gastrointestinal',
'SICK' ,
'16 Oct 2025',
'17 Oct 2025',
'Sick')
END ELSE PRINT('2347: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1262')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1262'),
'Gastrointestinal',
'SICK' ,
'09 Sep 2025',
'11 Sep 2025',
'Sick')
END ELSE PRINT('1262: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1876')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1876'),
'Gastrointestinal',
'SICK' ,
'11 Sep 2025',
'12 Sep 2025',
'Sick')
END ELSE PRINT('1876: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1545')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1545'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'09 Oct 2025',
'10 Oct 2025',
'Sick')
END ELSE PRINT('1545: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2294')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2294'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'01 Oct 2025',
'07 Oct 2025',
'Sick')
END ELSE PRINT('2294: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2583')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2583'),
'Other',
'OTH' ,
'07 Oct 2025',
'07 Oct 2025',
'Sick')
END ELSE PRINT('2583: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2219')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2219'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'10 Sep 2025',
'11 Sep 2025',
'Sick')
END ELSE PRINT('2219: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2416')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2416'),
'Other',
'OTH' ,
'05 Nov 2025',
'07 Nov 2025',
'Sick')
END ELSE PRINT('2416: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2416')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2416'),
'Gastrointestinal',
'SICK' ,
'20 Aug 2025',
'22 Aug 2025',
'Sick')
END ELSE PRINT('2416: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1895')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1895'),
'Gastrointestinal',
'SICK' ,
'10 Jan 2025',
'10 Jan 2025',
'Sick')
END ELSE PRINT('1895: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2405')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2405'),
'Hospital appointment and/or treatment',
'APPT' ,
'28 Apr 2025',
'29 Apr 2025',
'Sick')
END ELSE PRINT('2405: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2405')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2405'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'15 Sep 2025',
'16 Sep 2025',
'Sick')
END ELSE PRINT('2405: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2405')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2405'),
'Other',
'OTH' ,
'18 Sep 2025',
'19 Sep 2025',
'Sick')
END ELSE PRINT('2405: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2405')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2405'),
'Other',
'OTH' ,
'23 Sep 2025',
'26 Sep 2025',
'Sick')
END ELSE PRINT('2405: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2575')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2575'),
'Musculoskeletal',
'MUSC' ,
'19 Aug 2025',
'19 Aug 2025',
'Sick')
END ELSE PRINT('2575: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2518')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2518'),
'Other',
'OTH' ,
'07 Oct 2025',
'07 Oct 2025',
'Sick')
END ELSE PRINT('2518: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1906')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1906'),
'Headache and/or Migraine',
'HEAD' ,
'10 Sep 2025',
'10 Sep 2025',
'Sick')
END ELSE PRINT('1906: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2518')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2518'),
'Gastrointestinal',
'SICK' ,
'19 Aug 2025',
'19 Aug 2025',
'Sick')
END ELSE PRINT('2518: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1696')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1696'),
'Other',
'OTH' ,
'26 Mar 2025',
'27 Mar 2025',
'Sick')
END ELSE PRINT('1696: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1696')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1696'),
'Other',
'OTH' ,
'06 Jan 2025',
'06 Jan 2025',
'Sick')
END ELSE PRINT('1696: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '607')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '607'),
'Gastrointestinal',
'SICK' ,
'11 Sep 2025',
'11 Sep 2025',
'Sick')
END ELSE PRINT('607: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '607')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '607'),
'Gastrointestinal',
'SICK' ,
'24 Jul 2025',
'25 Jul 2025',
'Sick')
END ELSE PRINT('607: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2325')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2325'),
'Other',
'OTH' ,
'18 Sep 2025',
'18 Sep 2025',
'Sick')
END ELSE PRINT('2325: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2579')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2579'),
'Other',
'OTH' ,
'23 Sep 2025',
'17 Oct 2025',
'Sick')
END ELSE PRINT('2579: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1627')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1627'),
'Headache and/or Migraine',
'HEAD' ,
'04 Sep 2025',
'05 Sep 2025',
'Sick')
END ELSE PRINT('1627: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2520')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2520'),
'Other',
'OTH' ,
'29 Sep 2025',
'29 Sep 2025',
'Sick')
END ELSE PRINT('2520: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1713')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '1713'),
'Other',
'OTH' ,
'09 Oct 2025',
'10 Oct 2025',
'Sick')
END ELSE PRINT('1713: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2581')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2581'),
'Other',
'OTH' ,
'01 Sep 2025',
'05 Sep 2025',
'Sick')
END ELSE PRINT('2581: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2202')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2202'),
'Cold, Covid or Flu symptoms',
'C,C&F' ,
'01 Aug 2025',
'01 Aug 2025',
'Sick')
END ELSE PRINT('2202: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2450')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2450'),
'Gastrointestinal',
'SICK' ,
'18 Aug 2025',
'18 Aug 2025',
'Sick')
END ELSE PRINT('2450: No rec found')
IF EXISTS(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2280')
BEGIN
INSERT INTO [dbo].[DB_OSP_ABSENCE]([Master_Id], [Reason_For_Absence], [Reason_For_Absence_Code], [Start_Date], [End_Date], [Reason])
VALUES(
(SELECT TOP 1 Right_Join FROM LNK_EMPLOYEE_CONTRACT lec INNER JOIN DT_EMPLOYEE e ON lec.left_Join = e.Entity_Id AND CAST(e.EmployeeID as varchar(20)) = '2280'),
'Gastrointestinal',
'SICK' ,
'26 Jun 2025',
'27 Jun 2025',
'Sick')
END ELSE PRINT('2280: No rec found')
