HiCan I combine this two stored procedures?Procedure1 (works)Update table_name set field1= case When Datediff(d, time1, GETDATE() ) < 6 then '1' When Datediff(d, time1, GETDATE()) between 6 and 10 then '2' When Datediff(d, time1, GETDATE()) > 10 then '3' end, field2= case When Datediff(d, time1, GETDATE() ) < 6 then '1' When Datediff(d, time1, GETDATE()) between 6 and 10 then '2' When Datediff(d, time1, GETDATE()) > 10 then '3' end,field3= case When Datediff(d, time1, GETDATE() ) < 6 then '1' When Datediff(d, time1, GETDATE()) between 6 and 10 then '2' When Datediff(d, time1, GETDATE()) > 10 then '3' end FROM table_name
Procedure2 (not working not corectly when are used multiple table fields)UPDATE table_name SET field1 = case When field1Status is Not NULL then '0' end,field2 = case When field2Status is Not NULL then '0' end,field3 = case When field3Status is Not NULL then '0' endfrom table_name
Or how to write Procedure2 to become the request value?if field1Status is NULL then update field1 with '0'Thanks