update questions set reply = case when @input is not null then @input else reply end where answer = ...
stackoverflow.com