--SELECT * FROM DT_JOB
--WHERE CAST(Identifying_Code as varchar(100)) = 'LZ1815'

--Print CONVERT(varchar(100), GetDate(), 108)
UPDATE DT_JOB SET Entity_End_Date = '21 Jun 2021' WHERE Ndx = 40499
--Print CONVERT(varchar(100), GetDate(), 108)

INSERT INTO [dbo].[DT_JOB]
           ([Entity_Id]
           ,[Entity_Start_Date]
           ,[Entity_End_Date]
           ,[Entity_Reason]
           ,[Entity_Notes]
           ,[Title]
           ,[Identifying_Code]
           ,[Status]
           ,[Authorisation]
           ,[Date_Authorised]
           ,[Security_Level]
           ,[Hours]
           ,[Hours_Basis]
           ,[Manpower_Category]
           ,[Job_Type]
           ,[Job_Time]
           ,[Subject_Area]
           ,[Finance_Code]
           ,[Car_Grade]
           ,[Working_Pattern]
           ,[Public_Holiday_Pattern]
           ,[Pay_Grade]
           ,[Contract_Type]
           ,[Location]
           ,[Department]
           ,[ManagingJob]
           ,[Custom1]
           ,[Custom2]
           ,[Custom3]
           ,[Custom4]
           ,[BudgetedHeadCount]
           ,[BudgetedFTE]
           ,[HRTimeDefaultPosition]
           ,[Job_Email]
           ,[USR_WorkAllocationPosition]
           ,[USR_Scorecard]
           ,[USR_WorkType]
           ,[USR_title1]
           ,[USR_IPEPoints]
           ,[USR_Impact]
           ,[USR_Contribution]
           ,[USR_Comm]
           ,[USR_Frame]
           ,[USR_Innovation]
           ,[USR_Complexity]
           ,[USR_Knowledge]
           ,[USR_Team]
           ,[USR_Breadth]
           ,[USR_Risk]
           ,[USR_Enviroment])
     SELECT 
           [Entity_Id]
           ,'22 Jun 2021'
           ,NULL
           ,[Entity_Reason]
           ,[Entity_Notes]
           ,[Title]
           ,[Identifying_Code]
           ,[Status]
           ,[Authorisation]
           ,[Date_Authorised]
           ,[Security_Level]
           ,[Hours]
           ,[Hours_Basis]
           ,[Manpower_Category]
           ,[Job_Type]
           ,[Job_Time]
           ,[Subject_Area]
           ,[Finance_Code]
           ,[Car_Grade]
           ,[Working_Pattern]
           ,[Public_Holiday_Pattern]
           ,[Pay_Grade]
           ,[Contract_Type]
           ,[Location]
           ,[Department]
           ,5981
           ,[Custom1]
           ,[Custom2]
           ,[Custom3]
           ,[Custom4]
           ,[BudgetedHeadCount]
           ,[BudgetedFTE]
           ,[HRTimeDefaultPosition]
           ,[Job_Email]
           ,[USR_WorkAllocationPosition]
           ,[USR_Scorecard]
           ,[USR_WorkType]
           ,[USR_title1]
           ,[USR_IPEPoints]
           ,[USR_Impact]
           ,[USR_Contribution]
           ,[USR_Comm]
           ,[USR_Frame]
           ,[USR_Innovation]
           ,[USR_Complexity]
           ,[USR_Knowledge]
           ,[USR_Team]
           ,[USR_Breadth]
           ,[USR_Risk]
           ,[USR_Enviroment]
FROM [dbo].[DT_JOB]
 WHERE Ndx = 40499

 --Print CONVERT(varchar(100), GetDate(), 108)


