I work on SQL server 2012 I need to using only one statement for update without using three statement separately
using case when or any other thing without using three update separated
can i do three statement below on one statement .
create Procedure [Parts].[LCStampInsertDataJob]
AS
begin
update s set s.AffectedProductID=P.PartId,ApprovedValidation=1 from [Parts].[LCStamp] s
inner join Parts.nop_part p on P.PartNumber=s.AffectedProduct
where s.Category=1581910 and s.AffectedProductID is null
update s set s.AffectedProductID=f.PartFamilyID,ApprovedValidation=1 from [Parts].[LCStamp] s
inner join Parts.nop_partsfamily f on f.FamilyName=s.AffectedProduct
where s.Category=1581911 and s.AffectedProductID is null
update s set s.AffectedProductID=cf.ID,ApprovedValidation=1 from [Parts].[LCStamp] s
INNER JOIN dbo.Core_Masked cf on cf.MaskedText=s.AffectedProduct
where s.Category=1581912 and s.AffectedProductID is null
End