I use dynamic SQL in stored procedure to calculate values and update a table SET @SQLStatement = 'UPDATE CAV_CalcValues ' SET @SQLStatement = @SQLStatement + 'SET '+@CAV_Column + '= '+@Formula SET @SQLStatement = @SQLStatement + ' FROM KRE_KeyRatioEuro KRE INNER JOIN CAV_CalcValues CAV' SET @SQLStatement = @SQLStatement + ' ON KRE.KRE_COM_id = CAV.CAV_COM_id AND KRE.KRE_TIM_id = CAV.CAV_TIM_id' SET @SQLStatement = @SQLStatement + ' JOIN KRX_KeyRatioXXEuro KRX ON KRE.KRE_COM_id = KRX.KRX_COM_id ' SET @SQLStatement = @SQLStatement + ' WHERE KRE.KRE_COM_id IN ('+@CompanyId+')' SET @SQLStatement = @SQLStatement + ' AND KRX.KRX_COM_id IN ('+@CompanyId+')' SET @SQLStatement = @SQLStatement + ' AND KRE.KRE_quarter = 0' EXEC(@SQLStatement) Basically I have an Update clause where @Formula can look like the following: ((KRE_MED_181)-(KRE_MED_14)-(KRE_MED_17))*(1-(KRX_MED_1))+(-(CAV_MED_199)-(KRE_MED_15)-(CAV_MED_200)) (different columns in different tables) The problem is that in the tables from where I take the values the values are allowed to be NULL but in formulas like above the resulting value will be set to NULL if only one value is NULL and I do not want that. Instead I want a null value be set to 0 so I get a value from the rest of the values in the formula. (13 + NULL + 26)= NULL But instead I want to replace NULL=0 (13 + 0 + 26)= =39 I know I can change the formula with a lot of CASE clauses to eliminate the NULL value and replace with 0. But I have like 200 formulas and it would take a long time to accomplish that. My question is, if it possible to in the stored procedure set something that automatically will replace a NULL value with a 0 in an easy way?