Question : SQL Server Update Statement

In my attached code...how do I set SRRate and SRAmt = Null where @salesRate < 0
1:
2:
3:
4:
5:
6:
7:
8:
update CRMPROD_01.dbo.P_Deals
	set FirstPmtDate=@FirstPmtDate,
		LastPmtDate=@LastPmtDate,
		PurchaseLoanDate=@LoanDate,
		FedPV=@FedPV,
		SRRate = @salesRate,
		SRAmt=@SRAmt
  where Dealid=@DealID;

Answer : SQL Server Update Statement

SRRate = case when @SalesRate < 0 then Null else @SalesRate end,
SRAmt = case when @SalesRate < 0 then Null else @SRAmt end
Random Solutions  
 
programming4us programming4us