DELETE T1 FROM [dbo].[GEBOS_Time_Tracking] T1 
INNER JOIN [temp].[GEBOS_Time_Tracking] T2 
ON T1.[PersNr] = T2.[PersNr] 
AND T1.[Day] = T2.[Day] 
AND T1.[ActivityTypeNr] = T2.[ActivityTypeNr] 
AND T1.[StartingTime] = T2.[StartingTime] 
GO

INSERT INTO [dbo].[GEBOS_Time_Tracking]
SELECT T1.*, datepart(HOUR, T1.[Duration]) * 60 + datepart(MINUTE, T1.[Duration]) as Zeitdauer FROM [temp].[GEBOS_Time_Tracking] T1
GO
