I have a procedure in SQL Server 2008 R2, I want to enter the data to vol_Hours column and check it before if it is not null then plus the entry with old data that it in the column, if it's NULL then add the entry to the column without plus the NULL value. I cannot add 2+NULL because it's = NULL. MY Code Is:
create procedure updateVolunteerHours
@vol_ID int, @vol_Hours int
As
if vol_Hours is NULL
-- vol_Hours it is the Column Name
Update Personal_Information set vol_Hours = @vol_Hours where vol_ID = @vol_ID
else
Update Personal_Information set vol_Hours = @vol_Hours + vol_Hours where vol_ID = @vol_ID